cri: append envs from image config to empty slice to avoid env lost

Signed-off-by: Yadong Zhang <yadzhang@gmail.com>
This commit is contained in:
zhangyadong.0808 2021-02-09 06:12:47 +08:00
parent ddcc431c11
commit 08318b1ab9

View File

@ -161,7 +161,7 @@ func (c *criService) containerSpec(
// 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())
}