mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-29 17:50:23 +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:
parent
c21cba2c52
commit
a9eae1e4f8
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user