Fixes needed to vendor buildkit into moby
Signed-off-by: Tibor Vass <tibor@docker.com>v0.8
parent
e68c2bc12f
commit
9dabe0545f
|
@ -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 {
|
||||
|
|
|
@ -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 := ""
|
||||
|
|
Loading…
Reference in New Issue