Skip to content

Commit

Permalink
removed deleteFunc reconciliation
Browse files Browse the repository at this point in the history
Signed-off-by: viktor.kramarenko <[email protected]>
  • Loading branch information
ViktorKram committed Jan 26, 2024
1 parent 2932997 commit f100a2c
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions images/agent/pkg/controller/lvm_logical_volume_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
}
}

Expand Down

0 comments on commit f100a2c

Please sign in to comment.