karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.12k stars 807 forks source link

Karmadactl join/unjoin is not idempotent #4779

Open Rains6 opened 1 month ago

Rains6 commented 1 month ago

What happened: When I use karmadactl to join a cluster, karmadactl exits abnormally due to environment problems. When I use karmadactl to join the same cluster again, an error message is displayed, indicating that the cluster already exists. (error message:the same cluster has been registered with name cluster1). According to the code, the join is not idempotent and needs to support reentrant. The unjoin is similar.

What you expected to happen: Run the karmadactl join command to join the same cluster. A success message is returned.

How to reproduce it (as minimally and precisely as possible): When karmadactl is used to join a cluster, the karmadactl program is terminated. When karmadactl is used to join the same cluster again, an error is reported.

Anything else we need to know?:

Environment: