From 9c8c8aa836c74193c3601d3318488ca23b8b7362 Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Wed, 14 Oct 2020 16:17:05 -0400 Subject: [PATCH] StorageCluster: don't consider pending uninstall as error 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: https://github.com/kubernetes-sigs/controller-runtime/issues/617 Signed-off-by: Raghavendra Talur --- pkg/controller/storagecluster/reconcile.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controller/storagecluster/reconcile.go b/pkg/controller/storagecluster/reconcile.go index aa4ebc780c..b23e38c16d 100644 --- a/pkg/controller/storagecluster/reconcile.go +++ b/pkg/controller/storagecluster/reconcile.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "os" + "time" "github.com/blang/semver" "github.com/go-logr/logr" @@ -188,7 +189,7 @@ 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 + 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