From bbdce238b1aa662d720a064bc1d691700c7a0724 Mon Sep 17 00:00:00 2001 From: Viktor Kramarenko Date: Wed, 2 Oct 2024 18:01:39 +0300 Subject: [PATCH] final refactoring Signed-off-by: Viktor Kramarenko --- .../src/pkg/controller/block_device_labels_watcher.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/images/sds-health-watcher-controller/src/pkg/controller/block_device_labels_watcher.go b/images/sds-health-watcher-controller/src/pkg/controller/block_device_labels_watcher.go index 7a4ec431..bafc6120 100644 --- a/images/sds-health-watcher-controller/src/pkg/controller/block_device_labels_watcher.go +++ b/images/sds-health-watcher-controller/src/pkg/controller/block_device_labels_watcher.go @@ -119,7 +119,7 @@ func reconcileBlockDeviceLabels(ctx context.Context, cl client.Client, log logge continue } - if !checkIfLVGInProgress(&lvg) { + if checkIfLVGInProgress(&lvg) { log.Warning(fmt.Sprintf("[reconcileBlockDeviceLabels] the LVMVolumeGroup %s is in a progress, retry later...", lvg.Name)) shouldRetry = true continue @@ -167,12 +167,12 @@ func checkIfLVGInProgress(newLVG *v1alpha1.LVMVolumeGroup) bool { for _, c := range newLVG.Status.Conditions { if c.Type == internal.TypeVGConfigurationApplied { if c.Reason == internal.ReasonUpdating || c.Reason == internal.ReasonCreating { - return false + return true } } } - return true + return false } func shouldTriggerLVGUpdateIfMatches(log logger.Logger, lvg *v1alpha1.LVMVolumeGroup, blockDevice *v1alpha1.BlockDevice, usedBdNames map[string]struct{}) bool {