cri: append envs from image config to empty slice to avoid env lost

Signed-off-by: Justin Terry (SF) <juterry@microsoft.com>
This commit is contained in:
Justin Terry (SF) 2021-02-18 16:39:28 -08:00
parent c32ccdf8be
commit 06e4e09567

View File

@ -62,7 +62,7 @@ func (c *criService) containerSpec(
// Apply envs from image config first, so that envs from container config // Apply envs from image config first, so that envs from container config
// can override them. // can override them.
env := imageConfig.Env env := append([]string{}, imageConfig.Env...)
for _, e := range config.GetEnvs() { for _, e := range config.GetEnvs() {
env = append(env, e.GetKey()+"="+e.GetValue()) env = append(env, e.GetKey()+"="+e.GetValue())
} }