From a5bdb014efc671ca8521c8b17a4696e53d6f5aed Mon Sep 17 00:00:00 2001 From: Aleksandr Zimin Date: Mon, 1 Apr 2024 02:52:49 +0300 Subject: [PATCH] Fix typo Signed-off-by: Aleksandr Zimin --- images/sds-local-volume-csi/driver/controller.go | 6 +++--- images/sds-local-volume-csi/internal/const.go | 4 ++-- images/sds-local-volume-csi/pkg/utils/func.go | 6 +++--- images/sds-local-volume-csi/pkg/utils/volume.go | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/images/sds-local-volume-csi/driver/controller.go b/images/sds-local-volume-csi/driver/controller.go index c3443adb..fce226eb 100644 --- a/images/sds-local-volume-csi/driver/controller.go +++ b/images/sds-local-volume-csi/driver/controller.go @@ -90,7 +90,7 @@ func (d *Driver) CreateVolume(ctx context.Context, request *csi.CreateVolumeRequ preferredNode = selectedNodeName d.log.Info(fmt.Sprintf("Selected node: %s, free space %s ", selectedNodeName, freeSpace.String())) - if LvmType == internal.LLMTypeThick { + if LvmType == internal.LVMTypeThick { if llvSize.Value() > freeSpace.Value() { return nil, status.Errorf(codes.Internal, "requested size: %s is greater than free space: %s", llvSize.String(), freeSpace.String()) } @@ -150,7 +150,7 @@ func (d *Driver) CreateVolume(ctx context.Context, request *csi.CreateVolumeRequ volumeCtx[internal.SubPath] = request.Name volumeCtx[internal.VGNameKey] = selectedLVG.Spec.ActualVGNameOnTheNode - if llvSpec.Type == internal.LLMTypeThin { + if llvSpec.Type == internal.LVMTypeThin { volumeCtx[internal.ThinPoolNameKey] = llvSpec.Thin.PoolName } else { volumeCtx[internal.ThinPoolNameKey] = "" @@ -306,7 +306,7 @@ func (d *Driver) ControllerExpandVolume(ctx context.Context, request *csi.Contro return nil, status.Errorf(codes.Internal, "error getting LVMVolumeGroup: %v", err) } - if llv.Spec.Type == internal.LLMTypeThick { + if llv.Spec.Type == internal.LVMTypeThick { lvgFreeSpace, err := utils.GetLVMVolumeGroupFreeSpace(*lvg) if err != nil { return nil, status.Errorf(codes.Internal, "error getting LVMVolumeGroupCapacity: %v", err) diff --git a/images/sds-local-volume-csi/internal/const.go b/images/sds-local-volume-csi/internal/const.go index 9bd59a5e..527c6094 100644 --- a/images/sds-local-volume-csi/internal/const.go +++ b/images/sds-local-volume-csi/internal/const.go @@ -26,8 +26,8 @@ const ( SubPath = "subPath" VGNameKey = "vgname" ThinPoolNameKey = "thinPoolName" - LLMTypeThin = "Thin" - LLMTypeThick = "Thick" + LVMTypeThin = "Thin" + LVMTypeThick = "Thick" LLVStatusCreated = "Created" BindingModeWFFC = "WaitForFirstConsumer" BindingModeI = "Immediate" diff --git a/images/sds-local-volume-csi/pkg/utils/func.go b/images/sds-local-volume-csi/pkg/utils/func.go index b6dce0b2..0aa29c25 100644 --- a/images/sds-local-volume-csi/pkg/utils/func.go +++ b/images/sds-local-volume-csi/pkg/utils/func.go @@ -177,12 +177,12 @@ func GetNodeWithMaxFreeSpace(log *logger.Logger, lvgs []v1alpha1.LvmVolumeGroup, for _, lvg := range lvgs { switch lvmType { - case internal.LLMTypeThick: + case internal.LVMTypeThick: freeSpace, err = GetLVMVolumeGroupFreeSpace(lvg) if err != nil { return "", freeSpace, fmt.Errorf("get free space for lvg %+v: %w", lvg, err) } - case internal.LLMTypeThin: + case internal.LVMTypeThin: thinPoolName, ok := storageClassLVGParametersMap[lvg.Name] if !ok { return "", freeSpace, fmt.Errorf("thin pool name for lvg %s not found in storage class parameters: %+v", lvg.Name, storageClassLVGParametersMap) @@ -384,7 +384,7 @@ func GetLVGList(ctx context.Context, kc client.Client) (*v1alpha1.LvmVolumeGroup func GetLLVSpec(log *logger.Logger, lvName string, selectedLVG v1alpha1.LvmVolumeGroup, storageClassLVGParametersMap map[string]string, nodeName, lvmType string, llvSize resource.Quantity) v1alpha1.LVMLogicalVolumeSpec { var llvThin *v1alpha1.ThinLogicalVolumeSpec - if lvmType == internal.LLMTypeThin { + if lvmType == internal.LVMTypeThin { llvThin = &v1alpha1.ThinLogicalVolumeSpec{} llvThin.PoolName = storageClassLVGParametersMap[selectedLVG.Name] log.Info(fmt.Sprintf("[GetLLVSpec] Thin pool name: %s", llvThin.PoolName)) diff --git a/images/sds-local-volume-csi/pkg/utils/volume.go b/images/sds-local-volume-csi/pkg/utils/volume.go index d4747ece..3444e87a 100644 --- a/images/sds-local-volume-csi/pkg/utils/volume.go +++ b/images/sds-local-volume-csi/pkg/utils/volume.go @@ -111,7 +111,7 @@ func (s *Store) Mount(devSourcePath, target string, isBlock bool, fsType string, s.Log.Trace("-----------------== start FormatAndMount ==---------------") - if lvmType == internal.LLMTypeThin { + if lvmType == internal.LVMTypeThin { s.Log.Trace(fmt.Sprintf("LVM type is Thin. Ckecking free space in thin pool %s", lvmThinPoolName)) } err = s.NodeStorage.FormatAndMount(devSourcePath, target, fsType, mntOpts)