Skip to content

Commit

Permalink
cleanup warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bdevcich committed Nov 27, 2024
1 parent db062c2 commit 430e675
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions internal/controller/filesystem_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,17 @@ func getBlockDeviceAndFileSystem(ctx context.Context, c client.Client, nnfNodeSt

return blockDevice, fileSystem, nil
case "lustre":
commandLines := nnfv1alpha4.NnfStorageProfileLustreCmdLines{}
var commandLines nnfv1alpha4.NnfStorageProfileLustreCmdLines

switch nnfNodeStorage.Spec.LustreStorage.TargetType {
case "mgt":
commandLines = nnfStorageProfile.Data.LustreStorage.MgtCmdLines
break
case "mgtmdt":
commandLines = nnfStorageProfile.Data.LustreStorage.MgtMdtCmdLines
break
case "mdt":
commandLines = nnfStorageProfile.Data.LustreStorage.MdtCmdLines
break
case "ost":
commandLines = nnfStorageProfile.Data.LustreStorage.OstCmdLines
break
default:
return nil, nil, dwsv1alpha2.NewResourceError("invalid Lustre target type %s", nnfNodeStorage.Spec.LustreStorage.TargetType).WithFatal()
}
Expand Down Expand Up @@ -225,7 +221,7 @@ func newZpoolBlockDevice(ctx context.Context, c client.Client, nnfNodeStorage *n
return nil, dwsv1alpha2.NewResourceError("could not get NnfNodeBlockStorage: %v", client.ObjectKeyFromObject(nnfNodeBlockStorage)).WithError(err).WithUserMessage("could not find storage allocation").WithMajor()
}

if nnfNodeBlockStorage.Status.Ready == false {
if !nnfNodeBlockStorage.Status.Ready {
return nil, dwsv1alpha2.NewResourceError("NnfNodeBlockStorage: %v not ready", client.ObjectKeyFromObject(nnfNodeBlockStorage))
}

Expand Down Expand Up @@ -277,7 +273,7 @@ func newLvmBlockDevice(ctx context.Context, c client.Client, nnfNodeStorage *nnf
return nil, dwsv1alpha2.NewResourceError("could not get NnfNodeBlockStorage: %v", client.ObjectKeyFromObject(nnfNodeBlockStorage)).WithError(err).WithUserMessage("could not find storage allocation").WithMajor()
}

if nnfNodeBlockStorage.Status.Ready == false {
if !nnfNodeBlockStorage.Status.Ready {
return nil, dwsv1alpha2.NewResourceError("NnfNodeBlockStorage: %v not ready", client.ObjectKeyFromObject(nnfNodeBlockStorage))
}

Expand Down

0 comments on commit 430e675

Please sign in to comment.