Skip to content

Commit

Permalink
Check cli version match only for running pods
Browse files Browse the repository at this point in the history
Fixes linkerd#11280

Signed-off-by: Takumi Sue <[email protected]>
  • Loading branch information
mikutas committed Aug 25, 2023
1 parent a4bec90 commit 58905f0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/healthcheck/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -1450,9 +1450,12 @@ func CheckProxyVersionsUpToDate(pods []corev1.Pod, versions version.Channels) er
// matches that of the CLI
func CheckIfProxyVersionsMatchWithCLI(pods []corev1.Pod) error {
for _, pod := range pods {
proxyVersion := k8s.GetProxyVersion(pod)
if proxyVersion != "" && proxyVersion != version.Version {
return fmt.Errorf("%s running %s but cli running %s", pod.Name, proxyVersion, version.Version)
status := k8s.GetPodStatus(pod)
if status == string(corev1.PodRunning) && containsProxy(pod) {
proxyVersion := k8s.GetProxyVersion(pod)
if proxyVersion != "" && proxyVersion != version.Version {
return fmt.Errorf("%s running %s but cli running %s", pod.Name, proxyVersion, version.Version)
}
}
}
return nil
Expand Down

0 comments on commit 58905f0

Please sign in to comment.