kubewharf / kubeadmiral

Multi-Cluster Kubernetes Orchestration
https://kubeadmiral.io
Apache License 2.0
816 stars 97 forks source link

fix: delete cluster failed when failed to remove finalizers #329

Closed wy-lucky closed 5 months ago

wy-lucky commented 5 months ago

When connecting to a member cluster using a ServiceAccountToken and removing the member cluster, the steps are as follows:

  1. Obtain the connection credentials from the ServiceAccountToken secret.
  2. Remove the connection credentials from the secret.
  3. Remove the finalizers from the fcluster.

In the event of a failure during the third step, when re-entering the queue, the first step retries to obtain the credentials from the secret. However, since the credentials were already deleted in the second step, the attempt to retrieve the credentials fails. Therefore, in this scenario, a retry is added in the third step to address this issue.