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

Method source

libimage/image.go:890–904  ·  view source on GitHub ↗

source returns the possibly cached image reference.

(ctx context.Context)

Source from the content-addressed store, hash-verified

888
889// source returns the possibly cached image reference.
890func (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})

Callers 2

InspectMethod · 0.95
ManifestMethod · 0.95

Calls 3

StorageReferenceMethod · 0.95
NewImageSourceMethod · 0.80
systemContextCopyMethod · 0.80

Tested by

no test coverage detected