Skip to content

Commit

Permalink
Always pass OriginalCompression to TryReusingBlobWithOptions
Browse files Browse the repository at this point in the history
There's no reason not to, and we will need it in other cases
as well.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
  • Loading branch information
mtrmac committed Feb 1, 2024
1 parent 7936837 commit 674fbfe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions copy/single.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,8 @@ func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, to
// Fixing that will probably require passing more information to TryReusingBlob() than the current version of
// the ImageDestination interface lets us pass in.
var requiredCompression *compressiontypes.Algorithm
var originalCompression *compressiontypes.Algorithm
if ic.requireCompressionFormatMatch {
requiredCompression = ic.compressionFormat
originalCompression = srcInfo.CompressionAlgorithm
}

// Check if we have a chunked layer in storage that's based on that blob. These layers are stored by their TOC digest.
Expand All @@ -710,7 +708,7 @@ func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, to
LayerIndex: &layerIndex,
SrcRef: srcRef,
RequiredCompression: requiredCompression,
OriginalCompression: originalCompression,
OriginalCompression: srcInfo.CompressionAlgorithm,
TOCDigest: tocDigest,
})
if err != nil {
Expand Down

0 comments on commit 674fbfe

Please sign in to comment.