From ee8fb3f05f98df706cb030c19f9674d9d6361a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BERNARD?= Date: Fri, 28 Jan 2022 12:08:09 +0100 Subject: [PATCH] rbd: Fix dataPool in createVolumeResponse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return the dataPool used to create the image instead of the default one provided by the createVolumeRequest. In case of topologyConstrainedDataPools, they may differ. Don't add datapool if it's not present Signed-off-by: Sébastien Bernard --- internal/rbd/controllerserver.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index b46780ee9..f1b6d1c57 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -166,6 +166,11 @@ func buildCreateVolumeResponse(req *csi.CreateVolumeRequest, rbdVol *rbdVolume) if rbdVol.RadosNamespace != "" { volumeContext["radosNamespace"] = rbdVol.RadosNamespace } + + if rbdVol.DataPool != "" { + volumeContext["dataPool"] = rbdVol.DataPool + } + volume := &csi.Volume{ VolumeId: rbdVol.VolID, CapacityBytes: rbdVol.VolSize,