Skip to content

Commit

Permalink
Record a (compressed, uncompressed) digest pair when zstd:chunked is …
Browse files Browse the repository at this point in the history
…created on-the-fly

This will allow matching the compressed blob in tryReusingBlobAsPending.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Jul 10, 2024
1 parent 7781850 commit 5249a77
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions storage/storage_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ func (s *storageImageDestination) PutBlobPartial(ctx context.Context, chunkAcces
out.CompressedDigest, blobDigest)
}
s.lockProtected.blobDiffIDs[blobDigest] = out.UncompressedDigest
// We trust ApplyDiffWithDiffer to validate or create both values correctly.
options.Cache.RecordDigestUncompressedPair(out.CompressedDigest, out.UncompressedDigest)
} else {
// Don’t identify layers by TOC if UncompressedDigest is available.
// - Using UncompressedDigest allows image reuse with non-partially-pulled layers
Expand Down

0 comments on commit 5249a77

Please sign in to comment.