-
Notifications
You must be signed in to change notification settings - Fork 15
validations: add pattern field validation
#44
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
validations: add pattern field validation
#44
Conversation
|
Welcome @LoginovIlia! |
|
/cc @jpbetz |
|
Just a heads up that this is on my list to take a look at soon. If I don't get to it today, it will be on my list for first thing next week. Thanks for contributing! |
everettraven
left a comment
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.
Overall, this looks really good - thanks for taking the time to contribute!
I'm requesting changes here because of some recent conversations I've had with folks that brought to my attention the importance of taking into account how loosening validations may impact both readers and writers of an API.
Because crdify doesn't have nuanced knowledge of a situation, we should add a knob here so that users of crdify that do not want to allow removal of a pattern constraint can do so and we should default to that behavior (we always default to the most restrictive at the moment).
|
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
|
/remove-lifecycle stale |
|
I updated the pattern validation and now removing the regex flags an incompatibility. I also added the |
everettraven
left a comment
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.
Overall, this looks pretty good - thanks @LoginovIlia for taking this work on!
I've just got a couple small comments that I'd like to be addressed (despite my previous self not following this guidance 😅 - something that I will need to go back and fix).
everettraven
left a comment
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 - thanks @LoginovIlia for the contribution!
/lgtm
everettraven
left a comment
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: everettraven, LoginovIlia The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does
Adds validation for the pattern field when a pattern is added or changed. Removing a pattern is still allowed
Rationale
Changing or adding a regex may block values that worked before, so we mark these changes. Removing a regex makes the input more open, so we do not mark it
Which issue(s) this PR is related to:
Fixes #21
Changes
pkg/validations/property/pattern.gowith unit testsdocs/validations.mdtest/patternaddedandtest/patternchanged