From 430e675976783ddc7c397b08733d5c180884f416 Mon Sep 17 00:00:00 2001 From: Blake Devcich Date: Wed, 27 Nov 2024 09:09:30 -0600 Subject: [PATCH] cleanup warnings --- internal/controller/filesystem_helpers.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/internal/controller/filesystem_helpers.go b/internal/controller/filesystem_helpers.go index 6ad9e129..033104db 100644 --- a/internal/controller/filesystem_helpers.go +++ b/internal/controller/filesystem_helpers.go @@ -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() } @@ -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)) } @@ -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)) }