-
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
Fix pkg/cosign/errors #3050
Fix pkg/cosign/errors #3050
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3050 +/- ##
==========================================
- Coverage 31.08% 30.94% -0.14%
==========================================
Files 155 155
Lines 9739 9747 +8
==========================================
- Hits 3027 3016 -11
- Misses 6250 6269 +19
Partials 462 462
|
1. Remove ThrowError This function is the identity function, so it doesn't appear to actually do anything? Tests pass after deleting it. 2. Unwrap Errors should implement Unwrap when they wrap another error so that errors.Is/As will work with it. 3. Don't break policy-controller This adds back some public symbols that were removed that prevent policy-controller from bumping its cosign dependency. They are marked deprecated. Signed-off-by: Jon Johnson <[email protected]>
@ChrisJBurns I think I'm missing some context for some of this stuff, do these changes seem ~reasonable to you? |
Hi @jonjohnsonjr , changes seem good with me! 👍 The |
I think that would have been better to do originally, but for the sake of the dependency graph, I think it's easier to just add these back (as deprecated) and then have policy-controller deal with that problem when it bumps cosign. |
@jonjohnsonjr Yep that's fair enough. Out of curiosity, do you know where else Cosign is used like it is in the policy controller? Just so I can bare it in mind when doing future changes? As from here onwards I'll be adding a bunch of exit codes for when certain errors happen (and encourage others to do the same - perfect for good first issues) |
I only happened upon this because I tried to bump a cosign dependency and it broke a policy-controller dep :P I think a lot of these are forks, but if you wanted to dig into it, I'd start here: https://pkg.go.dev/github.com/sigstore/cosign/pkg/cosign?tab=importedby |
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.
lgtm, thanks sorry for taking to long to review
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.
👍
This function is the identity function, so it doesn't appear to actually
do anything? Tests pass after deleting it.
Errors should implement Unwrap when they wrap another error so that
errors.Is/As will work with it.
This adds back some public symbols that were removed that prevent
policy-controller from bumping its cosign dependency. They are marked
deprecated.
https://github.com/sigstore/policy-controller/blob/b59a2bf7e4f95e2f9126ce8b4d9dd5bcfbd11c9f/pkg/webhook/validator.go#L518
https://github.com/sigstore/policy-controller/blob/b59a2bf7e4f95e2f9126ce8b4d9dd5bcfbd11c9f/pkg/webhook/validator.go#L836
https://github.com/sigstore/policy-controller/blob/b59a2bf7e4f95e2f9126ce8b4d9dd5bcfbd11c9f/pkg/webhook/validator.go#L912