diff --git a/cache/manager.go b/cache/manager.go index 2689804c..0fb0103e 100644 --- a/cache/manager.go +++ b/cache/manager.go @@ -106,7 +106,7 @@ func (cm *cacheManager) GetByBlob(ctx context.Context, desc ocispec.Descriptor, blobChainID := imagespecidentity.ChainID([]digest.Digest{desc.Digest, diffID}) descHandlers := descHandlersOf(opts...) - if descHandlers == nil || descHandlers[desc.Digest] == nil { + if desc.Digest != "" && (descHandlers == nil || descHandlers[desc.Digest] == nil) { if _, err := cm.ContentStore.Info(ctx, desc.Digest); errors.Is(err, errdefs.ErrNotFound) { return nil, NeedsRemoteProvidersError([]digest.Digest{desc.Digest}) } else if err != nil { diff --git a/cache/refs.go b/cache/refs.go index bbe95adb..2ddac6d1 100644 --- a/cache/refs.go +++ b/cache/refs.go @@ -147,7 +147,12 @@ func (cr *cacheRecord) isLazy(ctx context.Context) (bool, error) { if !getBlobOnly(cr.md) { return false, nil } - _, err := cr.cm.ContentStore.Info(ctx, digest.Digest(getBlob(cr.md))) + dgst := getBlob(cr.md) + // special case for moby where there is no compressed blob (empty digest) + if dgst == "" { + return false, nil + } + _, err := cr.cm.ContentStore.Info(ctx, digest.Digest(dgst)) if errors.Is(err, errdefs.ErrNotFound) { return true, nil } @@ -457,6 +462,10 @@ func (sr *immutableRef) extract(ctx context.Context, dhs DescHandlers, s session return nil, nil } + if sr.cm.Applier == nil { + return nil, errors.New("extract requires an applier") + } + eg, egctx := errgroup.WithContext(ctx) parentID := ""