-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
// ReasonInvalidTaskRunSpec indicates that PipelineRun.Spec.TaskRunSpecs[].PipelineTaskName is defined with | ||
// a not exist taskName in pipelineSpec. | ||
ReasonInvalidTaskRunSpec = "InvalidTaskRunSpecs" | ||
Comment on lines
+86
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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? |
||
// ReasonParameterTypeMismatch indicates that the reason for the failure status is that | ||
// parameter(s) declared in the PipelineRun do not have the some declared type as the | ||
// parameters(s) declared in the Pipeline that they are supposed to override. | ||
|
@@ -506,7 +507,7 @@ func (c *Reconciler) reconcile(ctx context.Context, pr *v1.PipelineRun, getPipel | |
|
||
// Ensure that the TaskRunSpecs defined are correct. | ||
if err := resources.ValidateTaskRunSpecs(pipelineSpec, pr); err != nil { | ||
pr.Status.MarkFailed(ReasonInvalidServiceAccountMapping, | ||
pr.Status.MarkFailed(ReasonInvalidTaskRunSpec, | ||
"PipelineRun %s/%s doesn't define taskRunSpecs correctly: %s", | ||
pr.Namespace, pr.Name, err) | ||
return controller.NewPermanentError(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.
🤔 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?