From 2459065de23ad155d359eea409034ba0a5b16269 Mon Sep 17 00:00:00 2001 From: geoffrey1330 Date: Wed, 21 Aug 2024 23:18:45 +0100 Subject: [PATCH] fixed codeQL error --- pkg/spdk/controllerserver.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/spdk/controllerserver.go b/pkg/spdk/controllerserver.go index 903ccb5..90636bb 100644 --- a/pkg/spdk/controllerserver.go +++ b/pkg/spdk/controllerserver.go @@ -342,7 +342,8 @@ func (cs *controllerServer) publishVolume(req *csi.CreateVolumeRequest, volumeID if err != nil { return nil, err } - if _, ok := req.GetParameters()["type"]; ok { + + if volType, ok := req.GetParameters()["type"]; ok && volType == "cache" { var hostID string hostID, err = cs.spdkNode.GetVolumeHostID(spdkVol.lvolID) if err != nil {