Copies of originally-compressed images from c/storage to uncompressed destinations don’t trigger MIME type updates #2182
Labels
kind/bug
A defect in an existing functionality (or a PR fixing it)
Originally reported in containers/podman#20611 (comment) : pull a zstd:chunked image, then
podman save
(todocker-archive
) fails withWhat happens here:
LayerInfosForCopy
returns an uncompressed MIME typeimageCopier.copyLayers
does account for theLayerInfosForCopy
changes by settingsrcInfosUpdated = true
. But that isn’t sufficient, because it is documented thatManifestUpdateOptions.LayerInfos
ignores the MIME type, the edit must be represented byCompressionOperation
+CompressionAlgorithm
.imageCopier.copyLayer
has code to compensate for this, by settingCompressionAlgorithm
based on MIME type. But it doesn’t setCompressionOperation: Decompress
for uncompressed MIME types; and it only applies on theTryReusingBlob
code path.CompressionOperation
+CompressionAlgorithm
are set separately, based just on the characteristics of the incoming blob. And when the blob is uncompressed, and the desired state is also uncompressed, there is “nothing to do”, and the code setsCompressionOperation: PreserveOriginal
,CompressionAlgorithm: nil
, i.e. “do no edits”.Ugh. This is going to be a mess to untangle.
BlobInfo
, and build some internal-only edit interface afresh? (A lot of work, and what would that look like?)copyLayer
, and havecopyBlobFromStream
preserve the supplied operation if it makes no changes?The text was updated successfully, but these errors were encountered: