mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-12 18:23:35 +00:00
rbd: the DeleteVolume CSI procedure should succeed on deleted images
If the RBD-image is deleted already, the DeleteVolume CSI procedure is expected to report success (as it should be idempotent). In case the returned error indicates "RBD image not found", the error is ignored and the DeleteVolume procedure continues. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
@ -1017,9 +1017,10 @@ func cleanupRBDImage(ctx context.Context,
|
||||
}
|
||||
}
|
||||
|
||||
// Deleting rbd image
|
||||
// Deleting rbd image, it isn't a failure if the image was deleted already.
|
||||
log.DebugLog(ctx, "deleting image %s", rbdVol.RbdImageName)
|
||||
if err = rbdVol.deleteImage(ctx); err != nil {
|
||||
err = rbdVol.deleteImage(ctx)
|
||||
if err != nil && !errors.Is(err, librbd.ErrNotFound) {
|
||||
log.ErrorLog(ctx, "failed to delete rbd image: %s with error: %v",
|
||||
rbdVol, err)
|
||||
|
||||
|
Reference in New Issue
Block a user