Skip to content

Commit

Permalink
cleanup: remove redundant reconcile Returns when add finalizer
Browse files Browse the repository at this point in the history
Signed-off-by: Xieql <xieqianglong@huawei.com>
  • Loading branch information
Xieql committed Oct 16, 2023
1 parent 269f04e commit 0104b02
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/cluster-operator/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ func (r *ClusterController) Reconcile(ctx context.Context, req ctrl.Request) (_
cluster.Status.Phase = string(capiv1.ClusterPhaseProvisioning)
conditions.MarkFalse(cluster, clusterv1alpha1.ReadyCondition, clusterv1alpha1.ProvisioningReason, capiv1.ConditionSeverityError, "Provisioning")
controllerutil.AddFinalizer(cluster, ClusterFinalizer)
return ctrl.Result{}, nil
}

// Handle deletion reconciliation loop.
Expand Down
1 change: 0 additions & 1 deletion pkg/fleet-manager/application_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ func (a *ApplicationManager) Reconcile(ctx context.Context, req ctrl.Request) (_
// Add finalizer if not exist to void the race condition.
if !controllerutil.ContainsFinalizer(app, ApplicationFinalizer) {
controllerutil.AddFinalizer(app, ApplicationFinalizer)
return ctrl.Result{}, nil
}

// there only one fleet, so pre-fetch it here.
Expand Down
1 change: 0 additions & 1 deletion pkg/fleet-manager/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ func (f *FleetManager) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.
if !controllerutil.ContainsFinalizer(fleet, FleetFinalizer) {
fleet.Status.Phase = fleetapi.RunningPhase
controllerutil.AddFinalizer(fleet, FleetFinalizer)
return ctrl.Result{}, nil
}

// Handle deletion reconciliation loop.
Expand Down

0 comments on commit 0104b02

Please sign in to comment.