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 <alex@buoyant.io>
This commit is contained in:
Alex Leong 2024-02-15 11:02:11 -08:00 committed by GitHub
parent bf7b039f41
commit d8be3e0353
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -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]
}