@@ -62,7 +62,8 @@ func (r *deletionReconciler) reconcile(ctx context.Context, workspace *tenancyv1
62
62
clusterName = logicalcluster .Name (a )
63
63
}
64
64
65
- if _ , err := r .getLogicalCluster (ctx , clusterName .Path ()); err != nil && ! apierrors .IsNotFound (err ) {
65
+ logicalCluster , err := r .getLogicalCluster (ctx , clusterName .Path ())
66
+ if err != nil && ! apierrors .IsNotFound (err ) {
66
67
return reconcileStatusStopAndRequeue , err
67
68
} else if apierrors .IsNotFound (err ) {
68
69
finalizers := sets .New [string ](workspace .Finalizers ... )
@@ -74,9 +75,11 @@ func (r *deletionReconciler) reconcile(ctx context.Context, workspace *tenancyv1
74
75
return reconcileStatusContinue , nil
75
76
}
76
77
77
- logger .Info ("Deleting LogicalCluster" )
78
- if err := r .deleteLogicalCluster (ctx , clusterName .Path ()); err != nil {
79
- return reconcileStatusStopAndRequeue , err
78
+ if logicalCluster .DeletionTimestamp .IsZero () {
79
+ logger .Info ("Deleting LogicalCluster" )
80
+ if err := r .deleteLogicalCluster (ctx , clusterName .Path ()); err != nil {
81
+ return reconcileStatusStopAndRequeue , err
82
+ }
80
83
}
81
84
82
85
// here we are waiting for the other shard to remove the finalizer of the Workspace
0 commit comments