`ControllerName` validation helper
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/
Which issue(s) this PR fixes:
Fixes #1410
Does this PR introduce a user-facing change?:
NONE
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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
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.
TBH I don't get the use case. Seems like each impl will make pick
controllerNameas a constant, and if its invalid they will pick a new one? Not sure why we need a Go helper...
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.
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.
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.
I factorized the regexp and kept only the v1beta1 instance.
We should be able to share all the v1beta1 code backwards to v1alpha2, rather than just the regexp no?
Sure, I factorized the whole helper and removed the v1alpha2 test case as it is useless now.
[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
- ~~OWNERS~~ [shaneutt,youngnick]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment