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)
| 309 | // |
| 310 | // Returns an error matching ErrNoSuchImage if an image matching ref was not found. |
| 311 | func 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 | } |
searching dependent graphs…