Merge pull request #5024 from yadzhang/deepcopy-imageconfig
cri: append envs from image config to empty slice to avoid env lost
This commit is contained in:
commit
c32ccdf8be
@ -161,7 +161,7 @@ func (c *criService) containerSpec(
|
|||||||
|
|
||||||
// Apply envs from image config first, so that envs from container config
|
// Apply envs from image config first, so that envs from container config
|
||||||
// can override them.
|
// can override them.
|
||||||
env := imageConfig.Env
|
env := append([]string{}, imageConfig.Env...)
|
||||||
for _, e := range config.GetEnvs() {
|
for _, e := range config.GetEnvs() {
|
||||||
env = append(env, e.GetKey()+"="+e.GetValue())
|
env = append(env, e.GetKey()+"="+e.GetValue())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user