From 0ef79c6fc0f6822529a460d29fdc4f220fc43c1f Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Mon, 21 Feb 2022 17:02:38 +0530 Subject: [PATCH] rbd: set metadata on restart of provisioner pod Make sure to set metadata when image exist, i.e. if the provisioner pod is restarted while createVolume is in progress, say it created the image but didn't yet set the metadata. 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 c39e943cc..5d99b539f 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -452,6 +452,12 @@ func (cs *ControllerServer) repairExistingVolume(ctx context.Context, req *csi.C } } + // Set metadata on restart of provisioner pod when image exist + err := rbdVol.setVolumeMetadata(req.GetParameters()) + if err != nil { + return nil, err + } + return buildCreateVolumeResponse(req, rbdVol), nil }