diff --git a/storage/storage_dest.go b/storage/storage_dest.go index 73f442aeed..203ec549f0 100644 --- a/storage/storage_dest.go +++ b/storage/storage_dest.go @@ -325,6 +325,14 @@ func (s *storageImageDestination) tryReusingBlobAsPending(digest digest.Digest, s.lock.Lock() defer s.lock.Unlock() + toc, err := chunked.GetTOCDigest(options.Annotations) + if err != nil { + return false, private.ReusedBlob{}, err + } + if toc != nil { + digest = *toc + } + if options.SrcRef != nil { // Check if we have the layer in the underlying additional layer store. aLayer, err := s.imageRef.transport.store.LookupAdditionalLayer(digest, options.SrcRef.String()) @@ -558,7 +566,10 @@ func (s *storageImageDestination) getDiffIDFromDigest(uncompressedDigest digest. s.lock.Lock() defer s.lock.Unlock() - d, found := s.diffOutputs[uncompressedDigest]; found { + if d, found := s.diffOutputs[uncompressedDigest]; found { + return d.TOCDigest, found + } + d, found := s.blobDiffIDs[uncompressedDigest] return d, found }