Skip to content

Commit

Permalink
StorageCluster: don't consider pending uninstall as error
Browse files Browse the repository at this point in the history
In the reconciler, we considered a pending uninstall operation as an
error. It resulted in slower reconciliation because of exponential
backoff. To avoid the exponential backoff, we need to return the request
with the requeueAfter value set.

See: kubernetes-sigs/controller-runtime#617

Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
  • Loading branch information
raghavendra-talur committed Oct 20, 2020
1 parent ff139d9 commit 72d0411
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controller/storagecluster/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"os"
"time"

"github.com/blang/semver"
"github.com/go-logr/logr"
Expand Down Expand Up @@ -187,7 +188,8 @@ func (r *ReconcileStorageCluster) Reconcile(request reconcile.Request) (reconcil
if contains(instance.GetFinalizers(), storageClusterFinalizer) {
err = r.deleteResources(instance, reqLogger)
if err != nil {
return reconcile.Result{}, err
reqLogger.Info("Uninstall in progress", "Status", err)
return reconcile.Result{RequeueAfter: time.Second * time.Duration(1)}, nil
}
reqLogger.Info("Removing finalizer")
// Once all finalizers have been removed, the object will be deleted
Expand Down

0 comments on commit 72d0411

Please sign in to comment.