Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mbobrovskyi
Copy link
Contributor

@mbobrovskyi mbobrovskyi commented Jan 22, 2025

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 use webhook.CustomValidator.

Related issue number

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@mbobrovskyi
Copy link
Contributor Author

cc @andrewsykim @kevin85421

@@ -0,0 +1,97 @@
package v1
Copy link

@mimowo mimowo Jan 27, 2025

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?

Copy link
Contributor Author

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.

Copy link

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

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?

Copy link

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.

Copy link
Contributor Author

@mbobrovskyi mbobrovskyi Jan 31, 2025

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.

@mimowo
Copy link

mimowo commented Jan 27, 2025

FYI this is the diff of the moved file against the old file: https://www.diffchecker.com/Pt0dqgAt/

@mimowo
Copy link

mimowo commented Jan 28, 2025

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

@mbobrovskyi mbobrovskyi force-pushed the cleanup/use-custom-webhook-validator branch from 45fbd9e to b25d718 Compare January 31, 2025 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants