From fc8b3b8ac627cba0e51da3a09abfe526cbe70037 Mon Sep 17 00:00:00 2001 From: Suleyman Akbas Date: Fri, 21 Apr 2023 11:57:01 +0200 Subject: [PATCH] fix: reduce reconcile interval for delayed devices Signed-off-by: Suleyman Akbas --- pkg/vgmanager/vgmanager_controller.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/vgmanager/vgmanager_controller.go b/pkg/vgmanager/vgmanager_controller.go index bdd5f8eee..06e7e73f1 100644 --- a/pkg/vgmanager/vgmanager_controller.go +++ b/pkg/vgmanager/vgmanager_controller.go @@ -106,7 +106,7 @@ func (r *VGReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Re } var reconcileInterval = time.Minute * 1 -var reconcileAgain ctrl.Result = ctrl.Result{Requeue: true, RequeueAfter: reconcileInterval} +var reconcileAgain = ctrl.Result{Requeue: true, RequeueAfter: reconcileInterval} //TODO: Refactor this function to move the ctrl result to a single place @@ -162,9 +162,9 @@ func (r *VGReconciler) reconcile(ctx context.Context, req ctrl.Request, volumeGr } if len(matchingDevices) == 0 { - r.Log.Info("no matching devices for volume group", "VGName", volumeGroup.Name) + r.Log.Info("no matching devices found for volume group", "VGName", volumeGroup.Name) if len(delayedDevices) > 0 { - return reconcileAgain, nil + return ctrl.Result{Requeue: true, RequeueAfter: 30 * time.Second}, nil //30 seconds to make sure delayed devices become available } if found { @@ -563,7 +563,7 @@ func deleteLVMDConfig() error { return err } -func (r *VGReconciler) getMatchingDevicesForVG(volumeGroup *lvmv1alpha1.LVMVolumeGroup) (matching []internal.BlockDevice, delayed []internal.BlockDevice, err error) { +func (r *VGReconciler) getMatchingDevicesForVG(volumeGroup *lvmv1alpha1.LVMVolumeGroup) ([]internal.BlockDevice, []internal.BlockDevice, error) { // The LVMVolumeGroup was created/modified r.Log.Info("getting block devices for volumegroup", "VGName", volumeGroup.Name)