-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Force oci-mediatypes for containerimage outputs that utilize annotations #3061
Conversation
8b9492b
to
c40e12e
Compare
exporter/containerimage/opts.go
Outdated
} | ||
} | ||
|
||
func (c *ImageCommitOpts) EnableAttestations() { |
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.
Why is this called EnableAttestations
and not EnableOCITypes
(if the helper is needed at all). These opts don't know about attestations afaics.
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.
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.
Needs rebase. |
Signed-off-by: Justin Chadwell <[email protected]>
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 <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
c40e12e
to
0a5265a
Compare
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 |
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.