From f6be9be1ddc39c8899182e114e4117c5c9093a9c Mon Sep 17 00:00:00 2001 From: sophon Date: Wed, 25 Oct 2023 23:34:29 +0800 Subject: [PATCH] chore: intctrlutil.HandleCRDeletion may cause resources to be rolled back to an older version --- controllers/apps/configuration/configuration_controller.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/apps/configuration/configuration_controller.go b/controllers/apps/configuration/configuration_controller.go index 2aaf8572394..307baad4b66 100644 --- a/controllers/apps/configuration/configuration_controller.go +++ b/controllers/apps/configuration/configuration_controller.go @@ -34,7 +34,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" appsv1alpha1 "github.com/apecloud/kubeblocks/apis/apps/v1alpha1" - "github.com/apecloud/kubeblocks/pkg/constant" "github.com/apecloud/kubeblocks/pkg/controller/component" intctrlutil "github.com/apecloud/kubeblocks/pkg/controllerutil" ) @@ -74,8 +73,9 @@ func (r *ConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Reques return intctrlutil.CheckedRequeueWithError(err, reqCtx.Log, "cannot find configuration") } - if res, err := intctrlutil.HandleCRDeletion(reqCtx, r, configuration, constant.ConfigurationTemplateFinalizerName, nil); res != nil { - return *res, err + if !configuration.GetDeletionTimestamp().IsZero() { + reqCtx.Log.Info("configuration is deleting, skip reconcile") + return intctrlutil.Reconciled() } tasks := make([]Task, 0, len(configuration.Spec.ConfigItemDetails))