mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
rbd: add support for flattenMode option for replication
This commit adds support for flattenMode option for replication. If the flattenMode is set to "force" in volumereplicationclass parameters, cephcsi will add a task to flatten the image if it has parent. This enable cephcsi to then mirror such images after flattening them. The error message when the image's parent is in trash or unmirrored is improved as well. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
@ -1020,21 +1020,11 @@ func cleanupRBDImage(ctx context.Context,
|
||||
|
||||
// delete the temporary rbd image created as part of volume clone during
|
||||
// create volume
|
||||
tempClone := rbdVol.generateTempClone()
|
||||
err = tempClone.deleteImage(ctx)
|
||||
err = rbdVol.DeleteTempImage(ctx)
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrImageNotFound) {
|
||||
err = tempClone.ensureImageCleanup(ctx)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
} else {
|
||||
// return error if it is not ErrImageNotFound
|
||||
log.ErrorLog(ctx, "failed to delete rbd image: %s with error: %v",
|
||||
tempClone, err)
|
||||
log.ErrorLog(ctx, "failed to delete temporary rbd image: %v", err)
|
||||
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
||||
// Deleting rbd image
|
||||
|
Reference in New Issue
Block a user