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

Commit

Permalink
Merge pull request #1628 from zhsj/bpo-containerd-5024-5054
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
mikebrow committed Mar 2, 2021
2 parents b4b894c + e4fcda3 commit aa2d5a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/server/container_create_unix.go
Expand Up @@ -147,7 +147,7 @@ func (c *criService) containerSpec(id string, sandboxID string, sandboxPid uint3

// Apply envs from image config first, so that envs from container config
// can override them.
env := imageConfig.Env
env := append([]string{}, imageConfig.Env...)
for _, e := range config.GetEnvs() {
env = append(env, e.GetKey()+"="+e.GetValue())
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/container_create_windows.go
Expand Up @@ -52,7 +52,7 @@ func (c *criService) containerSpec(id string, sandboxID string, sandboxPid uint3

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

0 comments on commit aa2d5a9

Please sign in to comment.