-
Notifications
You must be signed in to change notification settings - Fork 443
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
imagetools(create): set correct media type when combining manifests #1797
Conversation
util/imagetools/create.go
Outdated
} | ||
|
||
var mt string | ||
if cnt, ok := mfstmt[ocispec.MediaTypeImageManifest]; ok && cnt == len(newDescs) { |
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.
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.
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.
Hum right we don't handle nested indexes in addDesc
atm
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.
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.
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.
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 <crazy-max@users.noreply.github.com>
0503001
to
b702188
Compare
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.