New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy: Support MIME type changes, two-step updates #1147
base: main
Are you sure you want to change the base?
Conversation
064918f
to
2877b1b
Compare
Hi, any progress on that? |
@mtrmac This needs a rebase I believe. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Not just a rebase, this is an alternative to #1138 and should, if pursued, revert/replace that. |
Ok let's close this and concentrate on whether or not the merged fix solves the issue. |
I need some way to track investigating this avenue. |
0ba6543
to
912da56
Compare
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>
Only call ic.src.LayerInfos() if necessary to evaluate UpdatedLayerInfosForCopy(). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
912da56
to
8040d74
Compare
See #1138 for the exploratory discussion, and commit messages for details.