MCPcopy Index your code
hub / github.com/docker/docker-agent / NormalizeReference

Function NormalizeReference

pkg/remote/pull.go:29–35  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

27// identity (e.g. cache keys spanning trust boundaries) must use
28// FullyQualifiedReference instead.
29func 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.

Calls 2

separatorFunction · 0.85
ContextMethod · 0.80