Merged
Conversation
We can now attach a reason for why each attestation was generated, which will in future allow us to include/exclude specific attestation types from exporters if desired. Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
jedevc
commented
Nov 30, 2022
| } | ||
|
|
||
| var inlineOnly bool | ||
| if v, err := strconv.ParseBool(attrs["inline-only"]); v && err == nil { |
Member
Author
There was a problem hiding this comment.
I'm not a fan of inline-only as the name of the option in hindsight. 1. It has a different meaning to inline for the exporters, and 2. it's not clear what property makes image/oci inline but not local/tar.
Other ideas welcome here 🎉
Member
There was a problem hiding this comment.
I'm not a fan of inline-only
attach / embed maybe?
tonistiigi
reviewed
Dec 6, 2022
Member
tonistiigi
left a comment
There was a problem hiding this comment.
In order to support the buildx case this should also change the mode defaults for provenance and remove mode=disabled.
Member
Author
|
|
Signed-off-by: Justin Chadwell <me@jedevc.com>
12e36ad to
8e107a6
Compare
tonistiigi
approved these changes
Dec 6, 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.
This will be useful to help with default values for docker/buildx#1412.
With this PR, buildx can attach the option
--opt attest:provenance=mode=min,inline-only=true. Thisinline-onlyoption is propagated through attestation metadata to the exporter, where it can be filtered out for the local/tar exporters, while being included for the image/oci/docker exporters. We could achieve similar functionality if we attempted to explicitly modify the exporter properties in buildx, but this would be overly complex logic to put into the client.Additionally, I've added a
reasonfield to the metadata, which can be optionally added to the metadata on attestation creation indicating the purpose of the attestation - in the future, this could be used by the exporter to filter out specific attestations for exporters (will be useful when we support multiple exporters, if different attestation output is desired). We could also (maybe) use the metadata in the SBOM scanner component to detect if the scanner has already run instead of relying on checking the predicate types.