| 31 | } |
| 32 | |
| 33 | func (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 | |
| 44 | func (d *blobCacheDestination) Reference() types.ImageReference { |
| 45 | return d.reference |