Skip to content

Commit

Permalink
e2e: update e2e test for topologysc
Browse files Browse the repository at this point in the history
Signed-off-by: parth-gr <[email protected]>
  • Loading branch information
parth-gr committed Mar 19, 2024
1 parent 7a2be75 commit 7c7d493
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion e2e/rbd_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions internal/rbd/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ func buildCreateVolumeResponse(req *csi.CreateVolumeRequest, rbdVol *rbdVolume)
},
}
}

return &csi.CreateVolumeResponse{Volume: volume}
}

Expand Down
5 changes: 4 additions & 1 deletion internal/rbd/rbd_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 7c7d493

Please sign in to comment.