Skip to content

Commit c95604f

Browse files
authored
Ensure that batch containers' kubexit death dependencies environment variable is deterministic (#2410)
1 parent 2e113bd commit c95604f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/workloads/k8s.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func TaskContainers(api spec.API, job *spec.JobKey) ([]kcore.Container, []kcore.
266266

267267
containerDeathDependencies := containerNames.Copy()
268268
containerDeathDependencies.Remove(c.Name)
269-
containerDeathEnvVars := getKubexitEnvVars(c.Name, containerDeathDependencies.Slice(), nil)
269+
containerDeathEnvVars := getKubexitEnvVars(c.Name, containerDeathDependencies.SliceSorted(), nil)
270270
containers[i].Env = append(containers[i].Env, containerDeathEnvVars...)
271271

272272
if c.Command[0] != "/cortex/kubexit" {
@@ -303,7 +303,7 @@ func BatchContainers(api spec.API, job *spec.BatchJob) ([]kcore.Container, []kco
303303

304304
containerDeathDependencies := containerNames.Copy()
305305
containerDeathDependencies.Remove(c.Name)
306-
containerDeathEnvVars := getKubexitEnvVars(c.Name, containerDeathDependencies.Slice(), nil)
306+
containerDeathEnvVars := getKubexitEnvVars(c.Name, containerDeathDependencies.SliceSorted(), nil)
307307
containers[i].Env = append(containers[i].Env, containerDeathEnvVars...)
308308

309309
if c.Command[0] != "/cortex/kubexit" {

0 commit comments

Comments
 (0)