Skip to content

Commit 08318b1

Browse files
committed
cri: append envs from image config to empty slice to avoid env lost
Signed-off-by: Yadong Zhang <[email protected]>
1 parent ddcc431 commit 08318b1

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)