-
Notifications
You must be signed in to change notification settings - Fork 547
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
2476 predicate type download #2484
2476 predicate type download #2484
Conversation
9a1f267
to
75b780b
Compare
Resolved all threads @hectorj2f |
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.
Regardless of the proposed solution, we are missing tests here.
Looks like I have a few more places to set arguments to FetchAttestationsForReference as well. |
Codecov Report
@@ Coverage Diff @@
## main #2484 +/- ##
==========================================
- Coverage 30.03% 29.95% -0.09%
==========================================
Files 139 139
Lines 8586 8609 +23
==========================================
Hits 2579 2579
- Misses 5649 5672 +23
Partials 358 358
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
0d76a22
to
835a336
Compare
E2E tests have been updated, as has the help text for |
@hectorj2f any outstanding issues on this PR that you see? |
Hi again @hectorj2f, just pinging on this again to see if it could be merged in. |
// AddFlags implements Interface | ||
func (o *AttestationDownloadOptions) AddFlags(cmd *cobra.Command) { | ||
cmd.Flags().StringVar(&o.PredicateType, "predicate-type", "", | ||
"download attestation with matching predicateType annotation") |
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.
Future suggestion: this could be an array of matching annotations.
I added more reviewers to avoid missing anything here. It looks good to me. |
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.
Sorry for the delay! Seems ok to me
BTW you may have to rebase to get tests to run, sorry! I'll re-approve quick this time. |
Signed-off-by: Tim Seagren <seagren.tim@solute.us>
Signed-off-by: Tim Seagren <seagren.tim@solute.us>
Signed-off-by: Tim Seagren <seagren.tim@solute.us>
Signed-off-by: Tim Seagren <seagren.tim@solute.us>
Signed-off-by: Tim Seagren <seagren.tim@solute.us>
…e-type option for attestation download Signed-off-by: Tim Seagren <seagren.tim@solute.us>
Signed-off-by: Tim Seagren <seagren.tim@solute.us>
Signed-off-by: Tim Seagren <seagren.tim@solute.us>
Signed-off-by: Tim Seagren <seagren.tim@solute.us>
Signed-off-by: Tim Seagren <seagren.tim@solute.us>
…p text for --predicate-type Signed-off-by: Tim Seagren <seagren.tim@solute.us>
Signed-off-by: Tim Seagren <seagren.tim@solute.us>
835a336
to
15d8562
Compare
@znewman01 no worries, rebased. |
* add cyclonedxxml predicatetype Signed-off-by: Tim Seagren <seagren.tim@solute.us> * read cyclonedx xml bytes into cyclonedx.SBOM Signed-off-by: Tim Seagren <seagren.tim@solute.us> * add e2e test Signed-off-by: Tim Seagren <seagren.tim@solute.us> * update cli docs Signed-off-by: Tim Seagren <seagren.tim@solute.us> * add artibrary annotations to mainfest Signed-off-by: Tim Seagren <seagren.tim@solute.us> * add predicateType annotation to attestation manifests, add --predicate-type option for attestation download Signed-off-by: Tim Seagren <seagren.tim@solute.us> * remove unrelated changes Signed-off-by: Tim Seagren <seagren.tim@solute.us> * update PredicateType as field of c Signed-off-by: Tim Seagren <seagren.tim@solute.us> * apply suggestions Signed-off-by: Tim Seagren <seagren.tim@solute.us> * remove unused index var Signed-off-by: Tim Seagren <seagren.tim@solute.us> * add e2e tests for attestation download, resolve data race, update help text for --predicate-type Signed-off-by: Tim Seagren <seagren.tim@solute.us> * CreateAttestationReplace Signed-off-by: Tim Seagren <seagren.tim@solute.us> --------- Signed-off-by: Tim Seagren <seagren.tim@solute.us>
Relates to #2476
Summary
This PR will add a
predicateType
annotation to the manifest of each attestation. This annotation can then be used with thecosign download attestation
command to output only the desired annotation, using a new—predicate-type
flag. If the flag is used, but nopredicateType
annotation is matched, an error is raised. If the flag is not provided, all attestations are returned, as they are currently.Release Note
New Feature: filter attestations output from
cosign download attestation
command by using the—predicate-type
flag.Documentation
This will require an update to the README for the
cosign download
command, which will be updated provided this seems like a good idea.