Skip to content

Commit

Permalink
Prepend env var defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson committed Oct 19, 2023
1 parent 7ab74fd commit 8fb678a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dask_kubernetes/operator/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ def build_worker_deployment_spec(
]
for i in range(len(deployment_spec["spec"]["template"]["spec"]["containers"])):
if "env" in deployment_spec["spec"]["template"]["spec"]["containers"][i]:
deployment_spec["spec"]["template"]["spec"]["containers"][i]["env"].extend(
env
)
deployment_spec["spec"]["template"]["spec"]["containers"][i]["env"][
:0
] = env
else:
deployment_spec["spec"]["template"]["spec"]["containers"][i]["env"] = env
return deployment_spec
Expand Down Expand Up @@ -197,7 +197,7 @@ def build_job_pod_spec(job_name, cluster_name, namespace, spec, annotations, lab
]
for i in range(len(pod_spec["spec"]["containers"])):
if "env" in pod_spec["spec"]["containers"][i]:
pod_spec["spec"]["containers"][i]["env"].extend(env)
pod_spec["spec"]["containers"][i]["env"][:0] = env
else:
pod_spec["spec"]["containers"][i]["env"] = env
return pod_spec
Expand Down

0 comments on commit 8fb678a

Please sign in to comment.