MCPcopy Create free account
hub / github.com/containers/image / TagNameOnly

Function TagNameOnly

docker/reference/normalize.go:156–168  ·  view source on GitHub ↗

TagNameOnly adds the default tag "latest" to a reference if it only has a repo name.

(ref Named)

Source from the content-addressed store, hash-verified

154// TagNameOnly adds the default tag "latest" to a reference if it only has
155// a repo name.
156func TagNameOnly(ref Named) Named {
157 if IsNameOnly(ref) {
158 namedTagged, err := WithTag(ref, defaultTag)
159 if err != nil {
160 // Default tag must be valid, to create a NamedTagged
161 // type with non-validated input the WithTag function
162 // should be used instead
163 panic(err)
164 }
165 return namedTagged
166 }
167 return ref
168}
169
170// ParseAnyReference parses a reference string as a possible identifier,
171// full digest, or familiar name.

Callers 6

addCandidateMethod · 0.92
ResolveLocallyFunction · 0.92
ParseStoreReferenceMethod · 0.92
ParseReferenceFunction · 0.92
ParseReferenceFunction · 0.92
ParseDockerRefFunction · 0.85

Calls 2

IsNameOnlyFunction · 0.85
WithTagFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…