mirror of https://github.com/containers/image.git
Queue a partially-pulled layer for commit immediately after staging it
Don't block all other layer commits until all layers are downloaded / staged. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
cdce0b6aa8
commit
39410b5461
|
|
@ -812,6 +812,7 @@ func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, to
|
|||
}
|
||||
uploadedBlob, err := ic.c.dest.PutBlobPartial(ctx, &proxy, srcInfo, private.PutBlobPartialOptions{
|
||||
Cache: ic.c.blobInfoCache,
|
||||
EmptyLayer: emptyLayer,
|
||||
LayerIndex: layerIndex,
|
||||
})
|
||||
if err == nil {
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ type PutBlobOptions struct {
|
|||
// PutBlobPartialOptions are used in PutBlobPartial.
|
||||
type PutBlobPartialOptions struct {
|
||||
Cache blobinfocache.BlobInfoCache2 // Cache to use and/or update.
|
||||
EmptyLayer bool // True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented.
|
||||
LayerIndex int // A zero-based index of the layer within the image (PutBlobPartial is only called with layer-like blobs, not configs)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -497,9 +497,12 @@ func (s *storageImageDestination) PutBlobPartial(ctx context.Context, chunkAcces
|
|||
|
||||
succeeded = true
|
||||
return private.UploadedBlob{
|
||||
Digest: blobDigest,
|
||||
Size: srcInfo.Size,
|
||||
}, nil
|
||||
Digest: blobDigest,
|
||||
Size: srcInfo.Size,
|
||||
}, s.queueOrCommit(options.LayerIndex, addedLayerInfo{
|
||||
digest: blobDigest,
|
||||
emptyLayer: options.EmptyLayer,
|
||||
})
|
||||
}
|
||||
|
||||
// TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination
|
||||
|
|
|
|||
Loading…
Reference in New Issue