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

Add a ClusterSet deletion webhook for the leader cluster #5475

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

luolanzone
Copy link
Contributor

@luolanzone luolanzone commented Sep 7, 2023

Add a ClusterSet deletion webhook to fail the ClusterSet deletion request
in the leader cluster when any MemberClusterAnnounce exists.

@luolanzone luolanzone added the area/multi-cluster Issues or PRs related to multi cluster. label Sep 7, 2023
@luolanzone luolanzone force-pushed the mc-leader-deletion-webhook branch 5 times, most recently from f6ad0c3 to 20a4ad7 Compare September 12, 2023 06:01
@luolanzone luolanzone requested a review from jianjuns September 13, 2023 02:02
@luolanzone
Copy link
Contributor Author

/test-multicluster-e2e

@luolanzone luolanzone added this to the Antrea v1.14 release milestone Sep 13, 2023
@jianjuns
Copy link
Contributor

In commit message MemberClusterResource -> MemberClusterAnnounce

@jianjuns jianjuns changed the title Add a ClusterSet deletion webhook on the leader cluster Add a ClusterSet deletion webhook for the leader cluster Sep 13, 2023
@@ -63,6 +63,13 @@ func runMember(o *Options) error {
Client: mgr.GetClient(),
namespace: env.GetPodNamespace()}})

hookServer.Register("/validate-multicluster-crd-antrea-io-v1alpha2-clusterset",
Copy link
Contributor

Choose a reason for hiding this comment

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

Question - we also need to register the handler for a member cluster?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this ClusterSet webhook was registered in controller.go before because there is no difference for the creation/update validation webhook in both leader and member clusters. But now, the deletion webhook is only required for the leader, so I moved this to the leader.go and member.go to get the role info. For the member cluster, it's no-ops for deletion event.

Add a ClusterSet deletion webhook to fail the ClusterSet deletion request
in the leader cluster when any MemberClusterAnnounce exists.

Signed-off-by: Lan Luo <[email protected]>
@luolanzone luolanzone force-pushed the mc-leader-deletion-webhook branch from 20a4ad7 to 74aebe8 Compare September 14, 2023 02:33
@luolanzone
Copy link
Contributor Author

/test-multicluster-e2e

@jianjuns
Copy link
Contributor

/skip-all

@jianjuns jianjuns merged commit a6ea1b6 into antrea-io:main Sep 15, 2023
@luolanzone luolanzone deleted the mc-leader-deletion-webhook branch October 10, 2023 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/multi-cluster Issues or PRs related to multi cluster.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants