-
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
fix: refine error resean with invalid pipelinename in taskrunspecs #6957
fix: refine error resean with invalid pipelinename in taskrunspecs #6957
Conversation
Hi @cugykw. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
The following is the coverage report on the affected files.
|
/ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom 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 |
The following is the coverage report on the affected files.
|
/cc @vdemeester |
@@ -83,8 +83,9 @@ const ( | |||
// ReasonInvalidWorkspaceBinding indicates that a Pipeline expects a workspace but a | |||
// PipelineRun has provided an invalid binding. | |||
ReasonInvalidWorkspaceBinding = "InvalidWorkspaceBindings" | |||
// ReasonInvalidServiceAccountMapping indicates that PipelineRun.Spec.TaskRunSpecs[].TaskServiceAccountName is defined with a wrong taskName | |||
ReasonInvalidServiceAccountMapping = "InvalidServiceAccountMappings" |
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.
🤔 Couldn't this happen still ?
I understand that we were sending this error wrongly (as it could have bee n something different that invalid service account mapping, but.. could/would we have cases where issuing this error is still valid ?
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.
ok, i kept this reason.
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 think this reason related function is removed, and deprecated? I don't see a reason to keep it.
#3028
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.
It is indeed not used here. This commit will be deleted first, and if it is used again later, it will be added?
5362f58
to
4caef5f
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
@@ -83,8 +83,9 @@ const ( | |||
// ReasonInvalidWorkspaceBinding indicates that a Pipeline expects a workspace but a | |||
// PipelineRun has provided an invalid binding. | |||
ReasonInvalidWorkspaceBinding = "InvalidWorkspaceBindings" | |||
// ReasonInvalidServiceAccountMapping indicates that PipelineRun.Spec.TaskRunSpecs[].TaskServiceAccountName is defined with a wrong taskName | |||
ReasonInvalidServiceAccountMapping = "InvalidServiceAccountMappings" |
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 think this reason related function is removed, and deprecated? I don't see a reason to keep it.
#3028
// ReasonInvalidTaskRunSpec indicates that PipelineRun.Spec.TaskRunSpecs[].PipelineTaskName is defined with | ||
// a not exist taskName in pipelineSpec. | ||
ReasonInvalidTaskRunSpec = "InvalidTaskRunSpecs" |
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.
InvalidTaskRunSpecs seems a bit vague here, we are actually validating the pipeline task name from taskrunspec is defined in pipeline tasks. I'm not sure, I won't disagree if we keep this naming..
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.
The ValidateTaskRunSpecs function currently only validates the name, but there may be other validations in the future? InvalidTaskRunSpecs indicates a large error type, combined with the message field to indicate a specific error?
4caef5f
to
a685221
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/lgtm |
Changes
This PR tries to modify the scene where the pipelineRun containing an invalid pipeline name in taskRunSpecs displays an error mismatch.
fix: #6956
/kind bug
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