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

Commit aa2d5a9

Browse files
authored
Merge pull request #1628 from zhsj/bpo-containerd-5024-5054
[release/1.4] append envs from image config to empty slice to avoid env lost ok to merge issue with CI test is non-related
2 parents b4b894c + e4fcda3 commit aa2d5a9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/server/container_create_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (c *criService) containerSpec(id string, sandboxID string, sandboxPid uint3
147147

148148
// Apply envs from image config first, so that envs from container config
149149
// can override them.
150-
env := imageConfig.Env
150+
env := append([]string{}, imageConfig.Env...)
151151
for _, e := range config.GetEnvs() {
152152
env = append(env, e.GetKey()+"="+e.GetValue())
153153
}

pkg/server/container_create_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (c *criService) containerSpec(id string, sandboxID string, sandboxPid uint3
5252

5353
// Apply envs from image config first, so that envs from container config
5454
// can override them.
55-
env := imageConfig.Env
55+
env := append([]string{}, imageConfig.Env...)
5656
for _, e := range config.GetEnvs() {
5757
env = append(env, e.GetKey()+"="+e.GetValue())
5858
}

0 commit comments

Comments
 (0)