Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
  • Loading branch information
AleksZimin committed Apr 14, 2024
1 parent decb017 commit a5bdb01
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions images/sds-local-volume-csi/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down Expand Up @@ -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] = ""
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions images/sds-local-volume-csi/internal/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions images/sds-local-volume-csi/pkg/utils/func.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion images/sds-local-volume-csi/pkg/utils/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a5bdb01

Please sign in to comment.