Skip to content

Commit

Permalink
chore(v2beta1): remove finalizer when rebalance completed or fialed
Browse files Browse the repository at this point in the history
Signed-off-by: Rory Z <[email protected]>
  • Loading branch information
Rory-Z committed Jul 30, 2023
1 parent 3b19400 commit 39676a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/apps/v2beta1/rebalance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@ func (r *RebalanceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
switch rebalance.Status.Phase {
case "Failed":
r.EventRecorder.Event(rebalance, corev1.EventTypeWarning, "Rebalance", "rebalance failed")
controllerutil.RemoveFinalizer(rebalance, finalizer)
return ctrl.Result{}, nil
case "Completed":
r.EventRecorder.Event(rebalance, corev1.EventTypeNormal, "Rebalance", "rebalance completed")
controllerutil.RemoveFinalizer(rebalance, finalizer)
return ctrl.Result{}, nil
case "Processing":
r.EventRecorder.Event(rebalance, corev1.EventTypeNormal, "Rebalance", "rebalance is processing")
Expand Down

0 comments on commit 39676a8

Please sign in to comment.