-
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
Introduce new attestation
exporter options
#3403
Conversation
de22d35
to
2aa3f8a
Compare
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.
I'm not convinced we should remove inline-only
. I think this is the correct way for client to ask for expected behavior without knowing too much about the internals. I don't mind a way to skip attestation on exporter level as well if there is a use case.
2aa3f8a
to
fe28241
Compare
Removed inline-only in #3420 - we shouldn't block the rest of the changes on that. |
} | ||
|
||
for _, att := range attestations { | ||
target, ok := att.Metadata[result.AttestationReasonKey] |
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.
Not from this PR but I don't understand why this is called a "reason". It is attestation type. So why can't we just use the already existing predicate type field?
Signed-off-by: Justin Chadwell <[email protected]>
This allows one implementation for all the opts parsing, similar to how we do today for the ImageCommitOpts. Additionally, we rename attestation-prefix to attestations-prefix (pluralized) to prepare for the new attestations option. Signed-off-by: Justin Chadwell <[email protected]>
This option looks like a mistake added in 45fc3ed. These options aren't ever used, so we don't need to parse them, we can just silently discard them. Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
Instead of just the boolean true/false values, we allow the attestation option for exporters to contain an arbitrary list of "attestation reasons". Only attestations that have a reason matching the list will actually be output. This allows clients to completely detach the concepts of "what attestations to generate" and "what attestations to output". Signed-off-by: Justin Chadwell <[email protected]>
fe28241
to
2488167
Compare
These replace the
inline-only
attestation fields introduce in #3342.Instead, we can now specify
attestations=<true/false/filter-list>
per exporter, to enable specific attestation per exporter - the default in buildkit is set totrue
. The possible values are:true
: output all provided attestations from the solverfalse
: output none of the provided attestations from the solverreason,[reasons]
: a csv list of reasons, outputs only the attestations that were generated for one of those specified reasons, using the metadata field. e.g.--output type=...,attestations=provenance
will only include provenance attestations in the output for that exporter, even if other attestations (like SBOMs) were generated in the solver.We also update the
attestation-prefix
option to beattestation[s]-prefix
- to be more aligned with the newattestations
flag.Additionally, we have a few smaller minor refactoring commits around the exporter: