Skip to content

Commit

Permalink
copy: provide compression info about copied blobs
Browse files Browse the repository at this point in the history
When copying a compressed blob without making any modifications to it,
set the CompressionFormat in the returned BlobInfo to reflect the
compression algorithm that was used to compress the blob.

Signed-off-by: Nalin Dahyabhai <[email protected]>
  • Loading branch information
nalind committed Feb 8, 2021
1 parent 6ac2fbc commit e15955f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion copy/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,11 @@ func (c *copier) copyBlobFromStream(ctx context.Context, srcStream io.Reader, sr
compressionOperation = types.PreserveOriginal
inputInfo = srcInfo
uploadCompressorName = srcCompressorName
uploadCompressionFormat = nil
if isCompressed {
uploadCompressionFormat = &compressionFormat
} else {
uploadCompressionFormat = nil
}
}

// === Encrypt the stream for valid mediatypes if ociEncryptConfig provided
Expand Down

0 comments on commit e15955f

Please sign in to comment.