Merge pull request #1883 from xyz2277/karmada-zyx-8

add Error message when unjoining cluster with a non-existent clustername
This commit is contained in:
karmada-bot 2022-06-16 15:03:08 +08:00 committed by GitHub
commit 75019ad1e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -271,7 +271,7 @@ func deleteClusterObject(controlPlaneKarmadaClient *karmadaclientset.Clientset,
err := controlPlaneKarmadaClient.ClusterV1alpha1().Clusters().Delete(context.TODO(), opts.ClusterName, metav1.DeleteOptions{})
if apierrors.IsNotFound(err) {
return nil
return fmt.Errorf("no cluster object %s found in karmada control Plane", opts.ClusterName)
}
if err != nil {
klog.Errorf("Failed to delete cluster object. cluster name: %s, error: %v", opts.ClusterName, err)