imagetools(create): set correct media type when combining manifests#1797
Merged
jedevc merged 1 commit intodocker:masterfrom May 18, 2023
Merged
imagetools(create): set correct media type when combining manifests#1797jedevc merged 1 commit intodocker:masterfrom
jedevc merged 1 commit intodocker:masterfrom
Conversation
jedevc
approved these changes
May 12, 2023
jedevc
reviewed
May 12, 2023
| } | ||
|
|
||
| var mt string | ||
| if cnt, ok := mfstmt[ocispec.MediaTypeImageManifest]; ok && cnt == len(newDescs) { |
Collaborator
There was a problem hiding this comment.
Obviously the edgiest of edge cases 😄
But I think this does the wrong thing if we have a nested index? e.g. if we have oci indexes nested inside an oci index? In that case, we should still use the oci type.
Member
Author
There was a problem hiding this comment.
Hum right we don't handle nested indexes in addDesc atm
Collaborator
There was a problem hiding this comment.
What about this as an alternative: we should check for a prefix of application/vnd.docker to see if all the types are docker types, then use a docker manifest list in that case. If they are all OCI or even just mix-and-matched, then we should default to OCI.
Member
Author
There was a problem hiding this comment.
As discussed yesterday, I'm fine defaulting to OCI.
When using imagetools create and combining multiple sources we should check the media type of each manifest and set the right media type for the manifest list. If there is a mismatch we set OCI index as best effort. Signed-off-by: CrazyMax <[email protected]>
0503001 to
b702188
Compare
jedevc
approved these changes
May 18, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using imagetools create and combining multiple sources we should check the media type of each manifest and set the right media type for the manifest list.
If there is a mismatch we set OCI index as best effort.