From 7c7d493321eae89036423c1e0cc7abaf9d94598d Mon Sep 17 00:00:00 2001 From: parth-gr Date: Fri, 15 Mar 2024 21:26:18 +0530 Subject: [PATCH] e2e: update e2e test for topologysc Signed-off-by: parth-gr --- e2e/rbd_helper.go | 5 ++++- internal/rbd/controllerserver.go | 1 + internal/rbd/rbd_util.go | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/e2e/rbd_helper.go b/e2e/rbd_helper.go index 3c448dd12ada..cc56f759a3e4 100644 --- a/e2e/rbd_helper.go +++ b/e2e/rbd_helper.go @@ -126,7 +126,10 @@ func createRBDStorageClass( if name != "" { sc.Name = name } - sc.Parameters["pool"] = defaultRBDPool + // add pool only if topologyConstrainedPools is not present + if _, ok := parameters["topologyConstrainedPools"]; !ok { + sc.Parameters["pool"] = defaultRBDPool + } sc.Parameters["csi.storage.k8s.io/provisioner-secret-namespace"] = cephCSINamespace sc.Parameters["csi.storage.k8s.io/provisioner-secret-name"] = rbdProvisionerSecretName diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index aab30c127ad5..414d0d025ee1 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -259,6 +259,7 @@ func buildCreateVolumeResponse(req *csi.CreateVolumeRequest, rbdVol *rbdVolume) }, } } + return &csi.CreateVolumeResponse{Volume: volume} } diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index 08f9f759889a..7485e0e7fed8 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -1270,9 +1270,12 @@ func genVolFromVolumeOptions( ) rbdVol := &rbdVolume{} + rbdVol.Pool, ok = volOptions["pool"] if !ok { - return nil, errors.New("missing required parameter pool") + if _, ok = volOptions["topologyConstrainedPools"]; !ok { + return nil, errors.New("empty pool name or topologyConstrainedPools to provision volume") + } } rbdVol.DataPool = volOptions["dataPool"]