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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尡 Move webhooks to internal #5711

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

kaitoii11
Copy link
Contributor

What this PR does / why we need it:
Move webhooks to internal and create alias.go for exposing Cluster and ClusterClass

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #5599

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 19, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @kaitoii11. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 19, 2021
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 19, 2021
@kaitoii11 kaitoii11 changed the title [WIP] 馃尡 Move webhooks to internal 馃尡 Move webhooks to internal Nov 19, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 19, 2021
@sbueringer
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 22, 2021
Makefile Outdated Show resolved Hide resolved
package webhooks

import (
clusterwebhooks "sigs.k8s.io/cluster-api/webhooks/internal/webhooks"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
clusterwebhooks "sigs.k8s.io/cluster-api/webhooks/internal/webhooks"
"sigs.k8s.io/cluster-api/webhooks/internal/webhooks"

I think that would be better. Afaik there should be no name conflict

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.

Two nits

Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

Looking good! Could you move the files from cluster-api/webhooks/internal/webhooks/ to cluster-api/internal/webhooks ?

Makefile Outdated Show resolved Hide resolved
@kaitoii11 kaitoii11 force-pushed the webhook-internalize branch 2 times, most recently from 55fc3e5 to 196c7dc Compare November 22, 2021 13:38
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 22, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 22, 2021

// SetupWebhookWithManager sets up Cluster webhooks.
func (webhook *Cluster) SetupWebhookWithManager(mgr ctrl.Manager) error {
return (&webhooks.Cluster{}).SetupWebhookWithManager(mgr)
Copy link
Member

Choose a reason for hiding this comment

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

~

Suggested change
return (&webhooks.Cluster{}).SetupWebhookWithManager(mgr)
return (&webhooks.Cluster{Client: webhook.Client}).SetupWebhookWithManager(mgr)

should fix the test failures

@sbueringer
Copy link
Member

/lgtm
assuming the test will probably be green now :)

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

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Nov 22, 2021

@kaitoii11: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-apidiff-main d096694 link false /test pull-cluster-api-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@killianmuldoon
Copy link
Contributor

I think the methods that are currently under /webhooks have to be deprecated rather than removed under our deprecation policy - that's why apidiff is failing.

@fabriziopandini
Copy link
Member

I think the methods that are currently under /webhooks have to be deprecated rather than removed under our deprecation policy - that's why apidiff is failing.

This is not necessary given that webhook folder is not part of any release so far; also, FYI "moving to internal" was discussed in tht community and we should just upgrade v1.0.0 -> v1.1.0 (does not apply in this case)

@sbueringer
Copy link
Member

I think the methods that are currently under /webhooks have to be deprecated rather than removed under our deprecation policy - that's why apidiff is failing.

This is not necessary given that webhook folder is not part of any release so far; also, FYI "moving to internal" was discussed in tht community and we should just upgrade v1.0.0 -> v1.1.0 (does not apply in this case)

Yup that's fine.

/lgtm

@killianmuldoon
Copy link
Contributor

Ah - I thought they would have been part of 1.01, but bugfix only means bugfix only 馃槃

/lgtm

@fabriziopandini
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 22, 2021
@k8s-ci-robot k8s-ci-robot merged commit f5e79e2 into kubernetes-sigs:main Nov 22, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.1 milestone Nov 22, 2021
@kaitoii11 kaitoii11 deleted the webhook-internalize branch November 25, 2021 14:54
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move webhook implementation to webhooks/internal
5 participants