Skip to content

Commit

Permalink
fixed codeQL error
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey1330 committed Aug 21, 2024
1 parent f4da5b8 commit 6216581
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/spdk/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check failure on line 346 in pkg/spdk/controllerserver.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

shadow: declaration of "err" shadows declaration at line 337 (govet)
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
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/util/nvmf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6216581

Please sign in to comment.