From 621658194165fb1278925919c89d215a705be231 Mon Sep 17 00:00:00 2001 From: geoffrey1330 Date: Wed, 21 Aug 2024 22:58:24 +0100 Subject: [PATCH] fixed codeQL error --- pkg/spdk/controllerserver.go | 6 +++--- pkg/util/nvmf.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/spdk/controllerserver.go b/pkg/spdk/controllerserver.go index 80d6b80..733f5fe 100644 --- a/pkg/spdk/controllerserver.go +++ b/pkg/spdk/controllerserver.go @@ -343,17 +343,17 @@ func (cs *controllerServer) publishVolume(req *csi.CreateVolumeRequest, volumeID return nil, err } if _, ok := req.GetParameters()["type"]; ok { - hostId, err := cs.spdkNode.GetVolumeHostID(spdkVol.lvolID) + hostID, err := cs.spdkNode.GetVolumeHostID(spdkVol.lvolID) if err != nil { return nil, err } - err = cs.spdkNode.CachingNodeConnect(hostId, spdkVol.lvolID) + err = cs.spdkNode.CachingNodeConnect(hostID, spdkVol.lvolID) if err != nil { klog.Errorf("error Connecting volume to host: %v", err) return nil, err } return map[string]string{ - "hostId": hostId, + "hostID": hostID, }, nil } diff --git a/pkg/util/nvmf.go b/pkg/util/nvmf.go index 86a174e..fb53e25 100644 --- a/pkg/util/nvmf.go +++ b/pkg/util/nvmf.go @@ -111,8 +111,8 @@ func (node *NodeNVMf) GetVolumeHostID(lvolID string) (string, error) { return "", err } - hostId := lvol.HostID - return hostId, err + hostID := lvol.HostID + return hostID, err } // ListVolumes returns a list of volumes