-
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
[TEP-0091] add condition for trusted resources #6654
Conversation
/kind feature |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/assign @wlynch |
242703a
to
14c3d4d
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/trustedresources/verify.go
Outdated
// VerifyTask verifies the signature and public key against task. | ||
// Skip the verification when no policies are found and trusted-resources-verification-no-match-policy is set to ignore or warn | ||
// Return an error when no policies are found and trusted-resources-verification-no-match-policy is set to fail, | ||
// or the resource fails to pass matched enforce verification policy | ||
// 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) error { | ||
func VerifyTask(ctx context.Context, taskObj *v1beta1.Task, k8s kubernetes.Interface, refSource *v1beta1.RefSource, verificationpolicies []*v1alpha1.VerificationPolicy) (*VerificationResult, error) { |
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.
VerifyTask and VerifyPipeline share lots of common code, I think we may merge them into 1 function in a follow-up pr
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
14c3d4d
to
726da1b
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
@Yongxuanzhang Thank you for taking the time to write a detailed/helpful commit message! It might be a bit tricky, but I do think it's possible to split this into multiple PRs. For example:
Can you play around with this a bit and see what PR splits are possible? |
Thanks for the suggestions! Let me try to split it as you suggested! |
/hold |
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.
|
The following is the coverage report on the affected files.
|
This commit adds the ConditionTrustedResourcesVerified for trusted resources into pipelinerun/taskrun status to show if the resources passes verification. Failing to verify will add a false condition to the taskrun/pipelinerun status and passing the verification will add a true status condition. Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com
d92601a
to
a17a0cb
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
@Yongxuanzhang: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Changes
This commit adds the ConditionTrustedResourcesVerified for trusted resources into pipelinerun/taskrun status to show if the resources passes verification. Failing to verify will add a false condition to the taskrun/pipelinerun status and passing the verification will add a true status condition.
Though this is a big size PR, it contains several changes which can be grouped into:
VerificationResult
to indicate different cases when the Verification doesn't return error (Files: verify.go)VerificationResult
back toreconcile
(Files: pipelineref.go, pipelinerunresolution.go, pipelinespec.go, taskref.go, taskspec.go)VerificationResult
(Files: taskrun.go, pipelinerun.go)Those changes cannot be split into separate PRs.
/kind feature
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