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" {