Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit 7ea3462

Browse files
committed
cri: append envs from image config to empty slice to avoid env lost
(cherry picked from commit containerd/containerd@08318b1) Signed-off-by: Yadong Zhang <[email protected]> Signed-off-by: Wei Fu <[email protected]>
1 parent 3a1c3b3 commit 7ea3462

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/server/container_create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func (c *criService) generateContainerSpec(id string, sandboxID string, sandboxP
359359

360360
// Apply envs from image config first, so that envs from container config
361361
// can override them.
362-
env := imageConfig.Env
362+
env := append([]string{}, imageConfig.Env...)
363363
for _, e := range config.GetEnvs() {
364364
env = append(env, e.GetKey()+"="+e.GetValue())
365365
}

0 commit comments

Comments
 (0)