-
Notifications
You must be signed in to change notification settings - Fork 498
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
ControllerName
validation helper
#1412
ControllerName
validation helper
#1412
Conversation
Hi @mlavacca. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. |
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.
TBH I don't get the use case. Seems like each impl will make pick controllerName
as a constant, and if its invalid they will pick a new one? Not sure why we need a Go helper...
I also don't mind though
2f37607
to
8aab82d
Compare
Recently in the Kong implementation, we have had to make it customizable via argument. This helper is meant to validate the controllerName in such a use case. |
8aab82d
to
fd0885b
Compare
I'm not sure why, but re-asking the review to @howardjohn, @sunjayBhatia, and @akankshakumari393 removed the review request to @mikemorris and @keithmattix. The PR is ready for review and all the conversations have been resolved. |
Yeah it happens, If you request one, the others would be removed from review request. |
For the case that people take the controllerName as an argument, having common code to validate seems like a great idea to me. /approve I'll leave the LGTM for someone else though. |
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.
Code and idea LGTM, however one thing I would like to talk about possibly changing:
We're putting this in two places with the same regex. Having copied code is usually not ideal. We recently made changes to share types between v1alpha2 and v1beta1 to reduce some of these copies, I think we should do the same here.
An utility to check the Controller name validity has been added to apis/<version>/util/validation. Signed-off-by: Mattia Lavacca <[email protected]>
Signed-off-by: Mattia Lavacca <[email protected]>
fd0885b
to
219ba50
Compare
I factorized the regexp and kept only the |
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.
We should be able to share all the v1beta1 code backwards to v1alpha2, rather than just the regexp no?
219ba50
to
9438511
Compare
Sure, I factorized the whole helper and removed the |
Signed-off-by: Mattia Lavacca <[email protected]>
9438511
to
0a51f09
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mlavacca, shaneutt, youngnick 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
A utility to check the Controller name validity has been added to apis//util/validation.
Which issue(s) this PR fixes:
Fixes #1410
Does this PR introduce a user-facing change?: