-
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
Validate PipelineTask name as Task names 📛 #2099
Validate PipelineTask name as Task names 📛 #2099
Conversation
The following is the coverage report on pkg/.
|
return &apis.FieldError{ | ||
Message: fmt.Sprintf("invalid value %q", t.Name), | ||
Paths: []string{fmt.Sprintf("spec.tasks[%d].name", i)}, | ||
Details: "Pipeline Task step name must be a valid DNS Label, For more info refer to https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", |
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.
Do we want the error message to be consistent with Task?
The Task "FooTask" is invalid: metadata.name: Invalid value: "FooTask": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
Remove step
after Pipeline Task
:
Details: "Pipeline Task step name must be a valid DNS Label, For more info refer to https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", | |
Details: "Pipeline Task name must be a valid DNS Label. For more info refer to https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", |
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.
Seeing there was another push here, but I am not seeing an update to the error message.
My thought is to make it so the error message here is consistent with what is shown for a Task that a user tries to create the violates naming conventions.
ad1924c
to
b93fd4e
Compare
The following is the coverage report on pkg/.
|
@vdemeester Can this comment below be addressed before this goes in?
|
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 once the error message change has been addressed.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbwsg 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 |
b93fd4e
to
ff3a6ce
Compare
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
The following is the coverage report on pkg/.
|
As reported, a `Pipeline` task name (`Pipelinetask`) can be created that will violate `TaskRun` naming rules, making it fail at runtime. This changes this by validation PipelineTask name the same way we validation `TaskRun` names, to make sure we won't fail for this at runtime. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
ff3a6ce
to
64b139f
Compare
The following is the coverage report on pkg/.
|
/lgtm |
Changes
As reported, a
Pipeline
task name (Pipelinetask
) can be createdthat will violate
TaskRun
naming rules, making it fail at runtime.This changes this by validation PipelineTask name the same way we
validation
TaskRun
names, to make sure we won't fail for this atruntime.
Closes #2095
Signed-off-by: Vincent Demeester vdemeest@redhat.com
/cc @bobcatfish @afrittoli @danielhelfand
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task to build and release this image.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes