From 79eff7ce4a17bae2e1f0ecb31a14a37ec9d3cc8a Mon Sep 17 00:00:00 2001 From: Viktor Kramarenko Date: Wed, 2 Oct 2024 20:09:01 +0300 Subject: [PATCH] final refactoring Signed-off-by: Viktor Kramarenko Signed-off-by: Aleksandr Zimin --- .../src/pkg/controller/lvm_volume_group_set_watcher.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images/sds-health-watcher-controller/src/pkg/controller/lvm_volume_group_set_watcher.go b/images/sds-health-watcher-controller/src/pkg/controller/lvm_volume_group_set_watcher.go index 4635bad6..7bfd839a 100644 --- a/images/sds-health-watcher-controller/src/pkg/controller/lvm_volume_group_set_watcher.go +++ b/images/sds-health-watcher-controller/src/pkg/controller/lvm_volume_group_set_watcher.go @@ -168,6 +168,8 @@ func provideLVMVolumeGroupsBySet(ctx context.Context, cl client.Client, log logg return err } log.Debug(fmt.Sprintf("[provideLVMVolumeGroupsBySet] successfully provided LVMVolumeGroups by the LVMVolumeGroupSet %s with strategy %s", lvgSet.Name, strategyPerNode)) + default: + return fmt.Errorf("LVMVolumeGroupSet %s strategy %s is not implemented", lvgSet.Name, lvgSet.Spec.Strategy) } return nil @@ -282,7 +284,7 @@ func configureLVGBySet(lvgSet *v1alpha1.LVMVolumeGroupSet, node v1.Node) *v1alph } func configureLVGNameFromSet(lvgSet *v1alpha1.LVMVolumeGroupSet) string { - return fmt.Sprintf("%s-%d", lvgSet.Name, len(lvgSet.Status.CreatedLVGs)+1) + return fmt.Sprintf("%s-%d", lvgSet.Name, len(lvgSet.Status.CreatedLVGs)) } func GetNodes(ctx context.Context, cl client.Client, metrics monitoring.Metrics, selector *metav1.LabelSelector) (map[string]v1.Node, error) {