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

Method NewImageSource

pkg/blobcache/src.go:38–47  ·  view source on GitHub ↗
(ctx context.Context, sys *types.SystemContext)

Source from the content-addressed store, hash-verified

36}
37
38func (b *BlobCache) NewImageSource(ctx context.Context, sys *types.SystemContext) (types.ImageSource, error) {
39 src, err := b.reference.NewImageSource(ctx, sys)
40 if err != nil {
41 return nil, fmt.Errorf("error creating new image source %q: %w", transports.ImageName(b.reference), err)
42 }
43 logrus.Debugf("starting to read from image %q using blob cache in %q (compression=%v)", transports.ImageName(b.reference), b.directory, b.compress)
44 s := &blobCacheSource{reference: b, source: imagesource.FromPublic(src), sys: *sys}
45 s.Compat = impl.AddCompat(s)
46 return s, nil
47}
48
49func (s *blobCacheSource) Reference() types.ImageReference {
50 return s.reference

Callers

nothing calls this directly

Calls 4

ImageNameFunction · 0.92
FromPublicFunction · 0.92
AddCompatFunction · 0.92
NewImageSourceMethod · 0.65

Tested by

no test coverage detected