diff --git a/e2e/rbd.go b/e2e/rbd.go index e4c320c26d60..c8b71817b367 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -3043,19 +3043,21 @@ var _ = Describe("RBD", func() { } By("ensuring created PV has its CSI journal in the CSI journal specific pool") - err = checkPVCCSIJournalInPool(f, pvc, "replicapool") + err = checkPVCCSIJournalInPool(f, pvc, rbdTopologyPool) if err != nil { framework.Failf("failed to check csi journal in pool: %v", err) } - err = deleteJournalInfoInPool(f, pvc, "replicapool") + err = deleteJournalInfoInPool(f, pvc, rbdTopologyPool) if err != nil { framework.Failf("failed to delete omap data: %v", err) } + err = deletePVCAndApp("", f, pvc, app) if err != nil { framework.Failf("failed to delete PVC and application: %v", err) } + validateRBDImageCount(f, 0, defaultRBDPool) validateOmapCount(f, 0, rbdType, defaultRBDPool, volumesType) @@ -3092,7 +3094,7 @@ var _ = Describe("RBD", func() { framework.Failf("failed to check data pool for image: %v", err) } - err = deleteJournalInfoInPool(f, pvc, "replicapool") + err = deleteJournalInfoInPool(f, pvc, rbdTopologyPool) if err != nil { framework.Failf("failed to delete omap data: %v", err) } 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"]