Skip to content

Commit c32ccdf

Browse files
authored
Merge pull request #5024 from yadzhang/deepcopy-imageconfig
cri: append envs from image config to empty slice to avoid env lost
2 parents d30a6c0 + 08318b1 commit c32ccdf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/cri/server/container_create_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func (c *criService) containerSpec(
161161

162162
// Apply envs from image config first, so that envs from container config
163163
// can override them.
164-
env := imageConfig.Env
164+
env := append([]string{}, imageConfig.Env...)
165165
for _, e := range config.GetEnvs() {
166166
env = append(env, e.GetKey()+"="+e.GetValue())
167167
}

0 commit comments

Comments
 (0)