From 26dfc6a3be6dc4d8381f97b8cb38de0a96c646ca Mon Sep 17 00:00:00 2001 From: Takumi Sue <23391543+mikutas@users.noreply.github.com> Date: Tue, 12 Sep 2023 07:30:15 +0900 Subject: [PATCH] Check cli version match only for running pods (#11295) Fixes #11280 Signed-off-by: Takumi Sue --- pkg/healthcheck/healthcheck.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/healthcheck/healthcheck.go b/pkg/healthcheck/healthcheck.go index 6705f96a87649..2e9cbe2418f99 100644 --- a/pkg/healthcheck/healthcheck.go +++ b/pkg/healthcheck/healthcheck.go @@ -1429,7 +1429,7 @@ func CheckProxyVersionsUpToDate(pods []corev1.Pod, versions version.Channels) er outdatedPods := []string{} for _, pod := range pods { status := k8s.GetPodStatus(pod) - if status == string(corev1.PodRunning) && containsProxy(pod) { + if status == string(corev1.PodRunning) { proxyVersion := k8s.GetProxyVersion(pod) if proxyVersion == "" { continue @@ -1450,8 +1450,9 @@ func CheckProxyVersionsUpToDate(pods []corev1.Pod, versions version.Channels) er // matches that of the CLI func CheckIfProxyVersionsMatchWithCLI(pods []corev1.Pod) error { for _, pod := range pods { + status := k8s.GetPodStatus(pod) proxyVersion := k8s.GetProxyVersion(pod) - if proxyVersion != "" && proxyVersion != version.Version { + if status == string(corev1.PodRunning) && proxyVersion != "" && proxyVersion != version.Version { return fmt.Errorf("%s running %s but cli running %s", pod.Name, proxyVersion, version.Version) } }