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

Method NewImageDestination

pkg/blobcache/dest.go:33–42  ·  view source on GitHub ↗
(ctx context.Context, sys *types.SystemContext)

Source from the content-addressed store, hash-verified

31}
32
33func (b *BlobCache) NewImageDestination(ctx context.Context, sys *types.SystemContext) (types.ImageDestination, error) {
34 dest, err := b.reference.NewImageDestination(ctx, sys)
35 if err != nil {
36 return nil, fmt.Errorf("error creating new image destination %q: %w", transports.ImageName(b.reference), err)
37 }
38 logrus.Debugf("starting to write to image %q using blob cache in %q", transports.ImageName(b.reference), b.directory)
39 d := &blobCacheDestination{reference: b, destination: imagedestination.FromPublic(dest)}
40 d.Compat = impl.AddCompat(d)
41 return d, nil
42}
43
44func (d *blobCacheDestination) Reference() types.ImageReference {
45 return d.reference

Callers 1

TestBlobCacheFunction · 0.95

Calls 4

ImageNameFunction · 0.92
FromPublicFunction · 0.92
AddCompatFunction · 0.92
NewImageDestinationMethod · 0.65

Tested by 1

TestBlobCacheFunction · 0.76