diff --git a/storage/storage_dest.go b/storage/storage_dest.go index ee69693388..d9f77313b5 100644 --- a/storage/storage_dest.go +++ b/storage/storage_dest.go @@ -328,6 +328,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()) @@ -564,7 +572,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 }