agent-harness / tasks /patches /TASK_CR_010_source.patch
cuber12's picture
Publish agent harness research code and paper artifacts
d61821a verified
Raw
History Blame Contribute Delete
751 Bytes
diff --git a/executors/kubernetes/util.go b/executors/kubernetes/util.go
index 2f20f925..9a997c99 100644
--- a/executors/kubernetes/util.go
+++ b/executors/kubernetes/util.go
@@ -413,8 +413,11 @@ func buildVariables(bv spec.Variables) []api.EnvVar {
b.Value = bv.Get(b.Key)
}
e := api.EnvVar{
- Name: b.Key,
- Value: b.Value,
+ Name: b.Key,
+ // Escape "$" as "$$" so Kubernetes does not apply $(VAR_NAME) substitution
+ // to the value before it reaches the container. Kubernetes treats "$$" as a
+ // literal "$". See: https://kubernetes.io/docs/tasks/inject-data-application/define-interdependent-environment-variables/
+ Value: strings.ReplaceAll(b.Value, "$", "$$"),
}
if j, ok := idx[e.Name]; ok {
envs[j] = e