-
Notifications
You must be signed in to change notification settings - Fork 448
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
Use webhook.CustomValidator instead of deprecated webhook.Validator. #2803
base: master
Are you sure you want to change the base?
Use webhook.CustomValidator instead of deprecated webhook.Validator. #2803
Conversation
dbef958
to
d70b3e4
Compare
d70b3e4
to
d3ff906
Compare
7a8b212
to
45fbd9e
Compare
@@ -0,0 +1,97 @@ | |||
package v1 |
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.
@mbobrovskyi could you clarify why this file is moved?
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.
Kubebuilder, by default, generates webhooks in the internal directory, so I believe this is the better location. Additionally, make generate
generates DeepCopy functions for the RayClusterWebhook
, even though it is not an API object.
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.
Got it, would it be feasible to split into two commits ? So that the diffs are easier to read?
In any case posted #2803 (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.
Done
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.
Re-opening this, could we make the diff render as moving an existing file instead of a new file?
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.
You can render the diff like that by looking at the first commit now: 179525c. Unfortunately after the second commit (the move) GH gets confused.
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 can't move the existent file due to RayCluster is an API object.
FYI this is the diff of the moved file against the old file: https://www.diffchecker.com/Pt0dqgAt/ |
LGTM, I would still consider splitting the PR into dedicated commits to make it easier to read #2803 (comment), but the manual diff is also an option as posted. cc @andrewsykim @kevin85421 over to you |
45fbd9e
to
b25d718
Compare
Why are these changes needed?
Currently we are using
webhook.Validator
which was deprecated and removed on controller-runtime 1.20. As suggested on controller-runtime https://github.com/kubernetes-sigs/controller-runtime/blob/release-0.17/pkg/webhook/alias.go#L31 we should usewebhook.CustomValidator
.Related issue number
Checks