From b086c763a6910d38fb4480809e523dd2fc0db8b3 Mon Sep 17 00:00:00 2001 From: Shalini Bhaskara Date: Fri, 5 Aug 2022 07:55:47 -0700 Subject: [PATCH] Prevent reconciliation if CSINodeTopology instance is already at Success state (#1906) --- .../csinodetopology/csinodetopology_controller.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/syncer/cnsoperator/controller/csinodetopology/csinodetopology_controller.go b/pkg/syncer/cnsoperator/controller/csinodetopology/csinodetopology_controller.go index e486bcfaa4..a3e13337eb 100644 --- a/pkg/syncer/cnsoperator/controller/csinodetopology/csinodetopology_controller.go +++ b/pkg/syncer/cnsoperator/controller/csinodetopology/csinodetopology_controller.go @@ -245,6 +245,12 @@ func (r *ReconcileCSINodeTopology) reconcileForVanilla(ctx context.Context, requ // Error reading the object - return with err. return reconcile.Result{}, err } + // If the CR status is already at Success, do not reconcile further. + if instance.Status.Status == csinodetopologyv1alpha1.CSINodeTopologySuccess { + log.Infof("CSINodeTopology instance with name %q is already at %q state. No need to "+ + "reconcile further.", instance.Name, instance.Status.Status) + return reconcile.Result{}, err + } // Initialize backOffDuration for the instance, if required. backOffDurationMapMutex.Lock()