-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
merge VerifyTask and VerifyPipeline into VerifyResource #6724
Conversation
Skipping CI for Draft Pull Request. |
The following is the coverage report on the affected files.
|
415e770
to
e19203d
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/retest
|
tm, signature, err := prepareObjectMeta(v.ObjectMeta) | ||
if err != nil { | ||
return VerificationResult{VerificationResultType: VerificationError, Err: err} |
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.
can this block be moved out of the switch statement? I think metav1.Object
should have ObjectMeta.
Can you also link the TODO for supporting v1 task/pipeline verification?
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 tried but metav1.Object doesn't have ObjectMeta, it is an interface and has lots of methods.
Can you please open an issue tracking this flake? |
e19203d
to
7432654
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The root bug isn't with Tekton, but knowing that this test is flaky will help us inform if we want to keep it in our test suite and help others know if a test failure they're seeing has been seen elsewhere. |
sorry Yongxuan I accidentally edited your comment instead of quote replying it! |
Oh I see, thanks! I'm opening one now. |
// VerificationResult is returned with different types for different cases: | ||
// 1) Return VerificationResult with VerificationSkip type, when no policies are found and no-match-policy is set to ignore | ||
// 2) Return VerificationResult with VerificationPass type when verification passed; | ||
// 3) Return VerificationResult with VerificationWarn type, when no matching policies and feature flag "no-match-policy" is "warn", or only Warn mode verification policies fail. Err field is filled with the warning; | ||
// 4) Return VerificationResult with VerificationError type when no policies are found and no-match-policy is set to fail, the resource fails to pass matched enforce verification policy, or there are errors during verification. Err is filled with the err. | ||
// refSource contains the source information of the task. | ||
func VerifyTask(ctx context.Context, taskObj *v1beta1.Task, k8s kubernetes.Interface, refSource *v1beta1.RefSource, verificationpolicies []*v1alpha1.VerificationPolicy) VerificationResult { |
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.
Wondering if we should preserve refactored functions like what we did for deprecated fields if that would be better for users? ie. func VerifyTask(..., task, ...) {VerifyResource(..., task, ...)} ?
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.
That's a good point, 🤔 Let me try that
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.
Added
7432654
to
728a4de
Compare
/test pull-tekton-pipeline-go-coverage |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JeromeJu, lbernick The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
728a4de
to
fdb8336
Compare
This commit merges VerifyTask and VerifyPipeline into VerifyResource to reduce duplicate code. Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com
fdb8336
to
ab53cb7
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/lgtm |
Changes
This commit merges VerifyTask and VerifyPipeline into VerifyResource to reduce duplicate code.
/kind cleanup
Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes