test digest or canonical reference, not only tag, when checking if an image is already present

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours 2025-10-20 17:44:57 +02:00 committed by Nicolas De loof
parent e25265dd55
commit da5c57c29d

View file

@ -159,12 +159,14 @@ func imageAlreadyPresent(serviceImage string, localImages map[string]api.ImageSu
if err != nil {
return false
}
tagged, ok := normalizedImage.(reference.NamedTagged)
if !ok {
return false
switch refType := normalizedImage.(type) {
case reference.NamedTagged:
_, ok := localImages[serviceImage]
return ok && refType.Tag() != "latest"
default:
_, ok := localImages[serviceImage]
return ok
}
_, ok = localImages[serviceImage]
return ok && tagged.Tag() != "latest"
}
func getUnwrappedErrorMessage(err error) string {