source returns the possibly cached image reference.
(ctx context.Context)
| 888 | |
| 889 | // source returns the possibly cached image reference. |
| 890 | func (i *Image) source(ctx context.Context) (types.ImageSource, error) { |
| 891 | if i.cached.imageSource != nil { |
| 892 | return i.cached.imageSource, nil |
| 893 | } |
| 894 | ref, err := i.StorageReference() |
| 895 | if err != nil { |
| 896 | return nil, err |
| 897 | } |
| 898 | src, err := ref.NewImageSource(ctx, i.runtime.systemContextCopy()) |
| 899 | if err != nil { |
| 900 | return nil, err |
| 901 | } |
| 902 | i.cached.imageSource = src |
| 903 | return src, nil |
| 904 | } |
| 905 | |
| 906 | // rawConfigBlob returns the image's config as a raw byte slice. Users need to |
| 907 | // unmarshal it to the corresponding type (OCI, Docker v2s{1,2}) |
no test coverage detected