NormalizeReference parses an OCI reference and returns the normalized store key that Pull uses to store artifacts. This ensures that equivalent references (e.g. "agentcatalog/review-pr" and "index.docker.io/agentcatalog/review-pr:latest") map to the same key. The registry host is deliberately strip
(registryRef string)
| 27 | // identity (e.g. cache keys spanning trust boundaries) must use |
| 28 | // FullyQualifiedReference instead. |
| 29 | func NormalizeReference(registryRef string) (string, error) { |
| 30 | ref, err := name.ParseReference(registryRef) |
| 31 | if err != nil { |
| 32 | return "", fmt.Errorf("parsing registry reference %s: %w", registryRef, err) |
| 33 | } |
| 34 | return ref.Context().RepositoryStr() + separator(ref) + ref.Identifier(), nil |
| 35 | } |
| 36 | |
| 37 | // FullyQualifiedReference returns the fully-qualified form of an OCI |
| 38 | // reference, including the registry host (e.g. |