From d8be3e0353651cf3b5c83451b84d4e093da72932 Mon Sep 17 00:00:00 2001 From: Alex Leong Date: Thu, 15 Feb 2024 11:02:11 -0800 Subject: [PATCH] ignore proxy imagees with digests when checking version (#12059) Fixes #12058 When proxy images are specified by digest rather than by tag, `linkerd check` will erroneously assume that the digest is a tag and attempt to compare it to the current Linkerd version. Instead, we ignore images with digests since there isn't an easy way to determine what version a digest corresponds to. Signed-off-by: Alex Leong --- pkg/k8s/api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/k8s/api.go b/pkg/k8s/api.go index 6ace4a1a9..b8f74ba51 100644 --- a/pkg/k8s/api.go +++ b/pkg/k8s/api.go @@ -306,6 +306,11 @@ func GetProxyReady(pod corev1.Pod) bool { func GetProxyVersion(pod corev1.Pod) string { for _, container := range pod.Spec.Containers { if container.Name == ProxyContainerName { + if strings.Contains(container.Image, "@") { + // Proxy container image is specified with digest instead of + // tag. We are unable to determine version. + return "" + } parts := strings.Split(container.Image, ":") return parts[len(parts)-1] }