From 06e4e09567d8dda4b6e9543d4c80f3ffce1a206a Mon Sep 17 00:00:00 2001 From: "Justin Terry (SF)" Date: Thu, 18 Feb 2021 16:39:28 -0800 Subject: [PATCH] cri: append envs from image config to empty slice to avoid env lost Signed-off-by: Justin Terry (SF) --- pkg/cri/server/container_create_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cri/server/container_create_windows.go b/pkg/cri/server/container_create_windows.go index 99d4539bb..a64fe6adf 100644 --- a/pkg/cri/server/container_create_windows.go +++ b/pkg/cri/server/container_create_windows.go @@ -62,7 +62,7 @@ func (c *criService) containerSpec( // Apply envs from image config first, so that envs from container config // can override them. - env := imageConfig.Env + env := append([]string{}, imageConfig.Env...) for _, e := range config.GetEnvs() { env = append(env, e.GetKey()+"="+e.GetValue()) }