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 <prasanna.kalever@redhat.com>
This commit is contained in:
Prasanna Kumar Kalever 2022-02-21 17:02:38 +05:30 committed by mergify[bot]
parent ae5925f04c
commit 0ef79c6fc0

View File

@ -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
}