Skip to content

Commit

Permalink
storage: use the TOC digest for partial layers
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jun 6, 2023
1 parent 8fc6be2 commit ede79c1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion storage/storage_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit ede79c1

Please sign in to comment.