-
Notifications
You must be signed in to change notification settings - Fork 228
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
Replace webhooks with CEL validation rules for LocalQueue #1938
Replace webhooks with CEL validation rules for LocalQueue #1938
Conversation
Welcome @IrvingMg! |
Hi @IrvingMg. 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. |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
/ok-to-test |
8519deb
to
2a2aa19
Compare
ClusterQueue ClusterQueueReference `json:"clusterQueue,omitempty"` | ||
} | ||
|
||
// ClusterQueueReference is the name of the ClusterQueue. | ||
// +kubebuilder:validation:MaxLength=253 | ||
// +kubebuilder:validation:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" |
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.
@jpbetz there is no CEL library for common k8s regexes, is there?
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.
Not yet, but @alexzielenski is working on adding them as part of declarative validation, both OpenAPI formats and CEL utility functions to check common regexes (like dns1123label) are planned.
EDIT: So using a RE2 regex directly that exactly matches the official k8s regex would be safe to migrate in the future.
By the way, this requires a release note. Also, please include the text |
/release-note-edit
|
/lgtm |
LGTM label has been added. Git tree hash: 9f9596cdbc9d18fb265b3b1084f763a3c961ffbf
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, IrvingMg 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 |
…-sigs#1938) * Replace webhooks with CEL for LocalQueue * Rename error matchers file * Add generic error matcher * Rename api error functions * Reimplement existing error matchers with the generic one
/release-note-edit
Just to match the format of other release notes. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
As mentioned in #463, we can enforce immutability and other validations using CEL rules instead of webhooks. Thus, this PR removes the validating webhooks for the
localqueue
type and adds the corresponding validation rules.Which issue(s) this PR fixes:
Relates to #463
Special notes for your reviewer:
Does this PR introduce a user-facing change?