From 0119d69ab2f67f8209ec64947d5af63c22d801f1 Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Mon, 21 Feb 2022 15:18:18 +0530 Subject: [PATCH] rbd: set PV/PVC details on the image as metadata on create This helps Monitoring solutions without access to Kubernetes clusters to display the details of the PV/PVC/NameSpace in their dashboard. Signed-off-by: Prasanna Kumar Kalever --- internal/rbd/controllerserver.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index 1dc179e28..c39e943cc 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -329,6 +329,12 @@ func (cs *ControllerServer) CreateVolume( return nil, err } + // Set Metadata on PV Create + err = rbdVol.setVolumeMetadata(req.GetParameters()) + if err != nil { + return nil, err + } + return buildCreateVolumeResponse(req, rbdVol), nil }