From f100a2c3aa2d35b75ec960732511fd8275387e65 Mon Sep 17 00:00:00 2001 From: "viktor.kramarenko" Date: Fri, 26 Jan 2024 21:23:04 +0300 Subject: [PATCH] removed deleteFunc reconciliation Signed-off-by: viktor.kramarenko --- .../controller/lvm_logical_volume_watcher.go | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/images/agent/pkg/controller/lvm_logical_volume_watcher.go b/images/agent/pkg/controller/lvm_logical_volume_watcher.go index d84e45b9..cf0b4be8 100644 --- a/images/agent/pkg/controller/lvm_logical_volume_watcher.go +++ b/images/agent/pkg/controller/lvm_logical_volume_watcher.go @@ -88,20 +88,20 @@ func RunLVMLogicalVolumeWatcherController( log.Info("[RunLVMLogicalVolumeWatcherController] UpdateFunc ends reconciliation") }, - DeleteFunc: func(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface) { - log.Info("[RunLVMLogicalVolumeWatcherController] DeleteFunc starts reconciliation") - - llv, ok := e.Object.(*v1alpha1.LvmLogicalVolume) - if !ok { - err := errors.New("unable to cast event object to a given type") - log.Error(err, "[RunLVMLogicalVolumeWatcherController] an error occurs while handling delete event") - return - } - - reconcileLLVDeleteFunc(ctx, cl, log, metrics, llv, cfg.NodeName) - - log.Info("[RunLVMLogicalVolumeWatcherController] DeleteFunc ends reconciliation") - }, + //DeleteFunc: func(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface) { + // log.Info("[RunLVMLogicalVolumeWatcherController] DeleteFunc starts reconciliation") + // + // llv, ok := e.Object.(*v1alpha1.LvmLogicalVolume) + // if !ok { + // err := errors.New("unable to cast event object to a given type") + // log.Error(err, "[RunLVMLogicalVolumeWatcherController] an error occurs while handling delete event") + // return + // } + // + // reconcileLLVDeleteFunc(ctx, cl, log, metrics, llv, cfg.NodeName) + // + // log.Info("[RunLVMLogicalVolumeWatcherController] DeleteFunc ends reconciliation") + //}, }) if err != nil { log.Error(err, "[RunLVMLogicalVolumeWatcherController] the controller is unable to watch") @@ -167,6 +167,7 @@ func removeLLVFinalizers(ctx context.Context, cl client.Client, metrics monitori llv.Finalizers = append(llv.Finalizers[:i], llv.Finalizers[i+1:]...) removed = true log.Debug(fmt.Sprintf("[removeLLVFinalizers] removed finalizer %s from the LVMLogicalVolume %s", internal.SdsNodeConfiguratorFinalizer, llv.Name)) + break } }