diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index 9e924710a6f2..21e33d0c71cb 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -252,6 +252,9 @@ func buildCreateVolumeResponse(req *csi.CreateVolumeRequest, rbdVol *rbdVolume) } } + // remove topologyConstrainedPools param as it is not required + delete(volumeContext, util.TopologyPoolsParam) + return &csi.CreateVolumeResponse{Volume: volume} } diff --git a/internal/util/topology.go b/internal/util/topology.go index 1f08ca6ff049..c289b8170bc0 100644 --- a/internal/util/topology.go +++ b/internal/util/topology.go @@ -30,6 +30,9 @@ import ( const ( keySeparator rune = '/' labelSeparator string = "," + + // topologyPoolsParam is the parameter name used to pass topology constrained pools + TopologyPoolsParam = "topologyConstrainedPools" ) // GetTopologyFromDomainLabels returns the CSI topology map, determined from @@ -129,7 +132,7 @@ func GetTopologyFromRequest( var topologyPools []TopologyConstrainedPool // check if parameters have pool configuration pertaining to topology - topologyPoolsStr := req.GetParameters()["topologyConstrainedPools"] + topologyPoolsStr := req.GetParameters()[TopologyPoolsParam] if topologyPoolsStr == "" { return nil, nil, nil }