Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement LayerInfosForCopy changing MIME types
Currently, horribly, types.UpdatedImage is _documented_ to ignore ManifestUpdateOptions.LayerInfos.MediaType; so if LayerInfosForCopy replaces a layer with a differently-compressed one, that MIME type update is never performed. First, work around that by adding updatedImageWithMIME as a hopefully temporary hack that implements the edit using CompressionOperation + CompressionAlgorithm (which are not documented to be ignored). Then, use it to process LayerInfosForCopy. Because LayerInfosForCopy's MediaType values are manifest-schema specific, we must call UpdatedImage(WithMime) twice: once just to update the layers with LayerInfosForCopy information using the original schema, and later to possibly convert the manifest and apply CompressionOperation/... from results of TryReusingBlob/PutBlob. So, move the LayerInfosForCopy processing before determineManifestConversion requests a MIME type change. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
- Loading branch information
Showing
1 changed file
with
54 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters