MCPcopy Create free account
hub / github.com/containers/common / normalizeTaggedDigestedString

Function normalizeTaggedDigestedString

libimage/normalize.go:141–157  ·  view source on GitHub ↗

normalizeTaggedDigestedString strips the tag off the specified string iff it is tagged and digested. Note that the tag is entirely ignored to match Docker behavior.

(s string)

Source from the content-addressed store, hash-verified

139// is tagged and digested. Note that the tag is entirely ignored to match
140// Docker behavior.
141func normalizeTaggedDigestedString(s string) (string, error) {
142 // Note that the input string is not expected to be parseable, so we
143 // return it verbatim in error cases.
144 ref, err := reference.Parse(s)
145 if err != nil {
146 return "", err
147 }
148 named, ok := ref.(reference.Named)
149 if !ok {
150 return s, nil
151 }
152 named, err = normalizeTaggedDigestedNamed(named)
153 if err != nil {
154 return "", err
155 }
156 return named.String(), nil
157}
158
159// normalizeTaggedDigestedNamed strips the tag off the specified named
160// reference iff it is tagged and digested. Note that the tag is entirely

Callers 3

PullMethod · 0.85
LookupImageMethod · 0.85

Calls 3

ParseMethod · 0.45
StringMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…