From 360f18d1cf6c36169ccbd9ffa5760196840be91e Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Thu, 10 Mar 2022 17:01:53 -0800 Subject: [PATCH] Always set pod-infra-container-image to protect it from image GC Signed-off-by: Brad Davidson --- pkg/daemons/agent/agent_linux.go | 3 ++- pkg/daemons/agent/agent_windows.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/daemons/agent/agent_linux.go b/pkg/daemons/agent/agent_linux.go index 2de6c4a69d..f493309c37 100644 --- a/pkg/daemons/agent/agent_linux.go +++ b/pkg/daemons/agent/agent_linux.go @@ -96,7 +96,8 @@ func kubeletArgs(cfg *config.Agent) map[string]string { if cfg.RuntimeSocket != "" { argsMap["serialize-image-pulls"] = "false" checkRuntimeEndpoint(cfg, argsMap) - } else if cfg.PauseImage != "" { + } + if cfg.PauseImage != "" { argsMap["pod-infra-container-image"] = cfg.PauseImage } if cfg.ImageServiceSocket != "" { diff --git a/pkg/daemons/agent/agent_windows.go b/pkg/daemons/agent/agent_windows.go index 6618ee583d..d36850e17e 100644 --- a/pkg/daemons/agent/agent_windows.go +++ b/pkg/daemons/agent/agent_windows.go @@ -88,7 +88,8 @@ func kubeletArgs(cfg *config.Agent) map[string]string { argsMap["container-runtime"] = "remote" argsMap["serialize-image-pulls"] = "false" checkRuntimeEndpoint(cfg, argsMap) - } else if cfg.PauseImage != "" { + } + if cfg.PauseImage != "" { argsMap["pod-infra-container-image"] = cfg.PauseImage } if cfg.ListenAddress != "" {