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

Function ResolveReference

storage/storage_reference.go:311–323  ·  view source on GitHub ↗

ResolveReference finds the underlying storage image for a storage.Transport reference. It returns that image, and an updated reference which can be used to refer back to the _same_ image again. This matters if the input reference contains a tagged name; the destination of the tag can move in local

(ref types.ImageReference)

Source from the content-addressed store, hash-verified

309//
310// Returns an error matching ErrNoSuchImage if an image matching ref was not found.
311func ResolveReference(ref types.ImageReference) (types.ImageReference, *storage.Image, error) {
312 sref, ok := ref.(*storageReference)
313 if !ok {
314 return nil, nil, fmt.Errorf("trying to resolve a non-%s: reference %q", Transport.Name(),
315 transports.ImageName(ref))
316 }
317 clone := *sref // A shallow copy we can update
318 img, err := clone.resolveImage(nil)
319 if err != nil {
320 return nil, nil, err
321 }
322 return clone, img, nil
323}

Callers 1

TestResolveReferenceFunction · 0.85

Calls 3

ImageNameFunction · 0.92
resolveImageMethod · 0.80
NameMethod · 0.65

Tested by 1

TestResolveReferenceFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…