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

Commit ca9c553

Browse files
authored
Merge pull request #1629 from fuweid/cherry-pick-cri-1628
[release/1.3] cri: append envs from image config to empty slice to avoid env lost
2 parents 3a1c3b3 + 7ea3462 commit ca9c553

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)