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

🌱 Move Cluster and ClusterClass webhook implementation to top level package #5596

Conversation

killianmuldoon
Copy link
Contributor

Move the implementations of validation checks from the internal API package to the webhooks package. The webhooks package was previously calling the public methods in the API package which are deprecated and due to be removed in a future release.

Some details of the internal methods of the validation methods were changed in order to make this move.

Fixes #5594

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 5, 2021
@killianmuldoon killianmuldoon force-pushed the pr-move-webhook-implementation branch 2 times, most recently from efdfb1d to d8db5ff Compare November 5, 2021 14:40
@killianmuldoon killianmuldoon changed the title 🌱 [WIP] Move Cluster and ClusterClass webhook implementation to top level package 🌱 Move Cluster and ClusterClass webhook implementation to top level package Nov 5, 2021
Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Looks good overall. A few nits

webhooks/cluster_test.go Outdated Show resolved Hide resolved
webhooks/cluster_test.go Outdated Show resolved Hide resolved
webhooks/cluster.go Outdated Show resolved Hide resolved
webhooks/clusterclass.go Outdated Show resolved Hide resolved
webhooks/clusterclass.go Outdated Show resolved Hide resolved
webhooks/clusterclass_test.go Outdated Show resolved Hide resolved
@sbueringer
Copy link
Member

lgtm +/- squash

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

only a tiny nit/question from my side, otherwise lgtm

webhooks/cluster.go Outdated Show resolved Hide resolved
…kage

Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
@sbueringer
Copy link
Member

sbueringer commented Nov 8, 2021

Not sure about the long method receiver, I've never seen one >2 or maybe >3 characters. But not a blocker and I couldn't find any guidance/recommendations.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2021
@killianmuldoon
Copy link
Contributor Author

Not sure about the long method receiver, I've never seen one >2 or maybe >3 characters. But not a blocker and I couldn't find any guidance/recommendations.

Agreed it's not ideal or common - but I do think there's a risk of confusion here because of the type name (But it's the only way that makes sense when importing webhooks.Cluster).

@fabriziopandini
Copy link
Member

/lgtm

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve
@killianmuldoon

// Deprecated: This method is going to be removed in a next release.
func (c *Cluster) Default() {
It'd be great if we can add a more specific depreacation message for folks that these have now moved here.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2021
@k8s-ci-robot k8s-ci-robot merged commit 0d01205 into kubernetes-sigs:main Nov 8, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.1 milestone Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move Cluster and Clusterclass validation checks to the top-level webhooks package
5 participants