Force oci-mediatypes for containerimage outputs that utilize annotations#3061
Merged
tonistiigi merged 3 commits intomoby:masterfrom Aug 26, 2022
Merged
Force oci-mediatypes for containerimage outputs that utilize annotations#3061tonistiigi merged 3 commits intomoby:masterfrom
tonistiigi merged 3 commits intomoby:masterfrom
Conversation
8b9492b to
c40e12e
Compare
tonistiigi
reviewed
Aug 26, 2022
| } | ||
| } | ||
|
|
||
| func (c *ImageCommitOpts) EnableAttestations() { |
Member
There was a problem hiding this comment.
Why is this called EnableAttestations and not EnableOCITypes (if the helper is needed at all). These opts don't know about attestations afaics.
Member
Author
There was a problem hiding this comment.
Have reworked the helper to EnableOCITypes that takes a reason as a log message. The helper is useful to get consistent warning messages for the different reasons we might change the oci mediatypes option, so I think it's worth keeping.
Member
|
Needs rebase. |
Signed-off-by: Justin Chadwell <me@jedevc.com>
The new annotations and attestations features both utilize annotations in the oci image format. Many registries allow setting these annotation fields on docker formats, however, notably, GCR will reject these objects and only allow them for OCI media types. To work around this, we enable oci-mediatypes when annotations that require OCI are enabled by the user, printing a warning to the user, similar to how we already do for stargz compression. Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
c40e12e to
0a5265a
Compare
Member
Author
|
I also noted that the previous annotations tests required containerd for part of it, so I've refactored them to push to a registry and then use the |
tonistiigi
approved these changes
Aug 26, 2022
tonistiigi
approved these changes
Aug 26, 2022
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.
Follow up to #2935, dependent on #3038.
The new annotations and attestations features both utilize annotations in the OCI image format. Many registries allow setting these annotation fields on docker formats, however, notably, GCR will reject these objects (see #1730) and only allow them for OCI media types.
To work around this, we enable oci-mediatypes when annotations that require OCI are enabled by the user, printing a warning to the user, similar to how we already do for stargz compression.
In the long-term, we should want to look at switching the default for oci-mediatypes to
true, so enabling this for users who want to use the new annotations and attestations is a good way to test drive this, and try to catch any potential issues that might arise.