From 6d70eb86588ea12842f60408a71c06b76e79db98 Mon Sep 17 00:00:00 2001 From: Praveen M Date: Thu, 14 Mar 2024 17:15:01 +0530 Subject: [PATCH] rbd: remove topologyConstrainedPools parameter This commit removes the `topologyConstrainedPools` parameter from PV volumeAttributes as it is not required. Signed-off-by: Praveen M --- internal/rbd/controllerserver.go | 3 +++ internal/util/topology.go | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 }