diff --git a/types/model/digest.go b/types/model/digest.go index d5a7a155..d908fa02 100644 --- a/types/model/digest.go +++ b/types/model/digest.go @@ -1,6 +1,7 @@ package model import ( + "fmt" "log/slog" "strings" "unicode" @@ -47,8 +48,11 @@ var ( // Digest. func ParseDigest(s string) Digest { typ, digest, ok := strings.Cut(s, "-") + if !ok { + typ, digest, ok = strings.Cut(s, ":") + } if ok && isValidDigestType(typ) && isValidHex(digest) { - return Digest{s: s} + return Digest{s: fmt.Sprintf("%s-%s", typ, digest)} } return Digest{} }