From 4d69684560faacfda791df96f82406ce8a39f606 Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Tue, 28 Dec 2021 16:51:58 -0800 Subject: [PATCH] Ensure that batch containers' kubexit death dependencies environment variable is deterministic --- pkg/workloads/k8s.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/workloads/k8s.go b/pkg/workloads/k8s.go index edbf7beab3..2f8fa4e557 100644 --- a/pkg/workloads/k8s.go +++ b/pkg/workloads/k8s.go @@ -266,7 +266,7 @@ func TaskContainers(api spec.API, job *spec.JobKey) ([]kcore.Container, []kcore. containerDeathDependencies := containerNames.Copy() containerDeathDependencies.Remove(c.Name) - containerDeathEnvVars := getKubexitEnvVars(c.Name, containerDeathDependencies.Slice(), nil) + containerDeathEnvVars := getKubexitEnvVars(c.Name, containerDeathDependencies.SliceSorted(), nil) containers[i].Env = append(containers[i].Env, containerDeathEnvVars...) if c.Command[0] != "/cortex/kubexit" { @@ -303,7 +303,7 @@ func BatchContainers(api spec.API, job *spec.BatchJob) ([]kcore.Container, []kco containerDeathDependencies := containerNames.Copy() containerDeathDependencies.Remove(c.Name) - containerDeathEnvVars := getKubexitEnvVars(c.Name, containerDeathDependencies.Slice(), nil) + containerDeathEnvVars := getKubexitEnvVars(c.Name, containerDeathDependencies.SliceSorted(), nil) containers[i].Env = append(containers[i].Env, containerDeathEnvVars...) if c.Command[0] != "/cortex/kubexit" {