From f3536193f423db7c3fbac2aa4fb0ae0dfc1ecf59 Mon Sep 17 00:00:00 2001 From: carlory Date: Sun, 2 Jan 2022 22:12:24 +0800 Subject: [PATCH] remove unreachable code Signed-off-by: carlory --- pkg/controllers/cluster/cluster_controller.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/controllers/cluster/cluster_controller.go b/pkg/controllers/cluster/cluster_controller.go index b32e6383189c..116d302441c5 100644 --- a/pkg/controllers/cluster/cluster_controller.go +++ b/pkg/controllers/cluster/cluster_controller.go @@ -123,9 +123,6 @@ func (c *Controller) syncCluster(cluster *clusterv1alpha1.Cluster) (controllerru func (c *Controller) removeCluster(cluster *clusterv1alpha1.Cluster) (controllerruntime.Result, error) { err := c.removeExecutionSpace(cluster) - if apierrors.IsNotFound(err) { - return c.removeFinalizer(cluster) - } if err != nil { klog.Errorf("Failed to remove execution space %v, err is %v", cluster.Name, err) c.EventRecorder.Event(cluster, corev1.EventTypeWarning, fmt.Sprintf("Failed %s", clusterv1alpha1.EventReasonCreateExecutionSpaceFailed), err.Error())