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:
@ -703,6 +703,22 @@ func (ri *rbdImage) trashRemoveImage(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteTempImage deletes the temporary image created for volume datasource.
|
||||
func (rv *rbdVolume) DeleteTempImage(ctx context.Context) error {
|
||||
tempClone := rv.generateTempClone()
|
||||
err := tempClone.deleteImage(ctx)
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrImageNotFound) {
|
||||
return tempClone.ensureImageCleanup(ctx)
|
||||
} else {
|
||||
// return error if it is not ErrImageNotFound
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ri *rbdImage) getCloneDepth(ctx context.Context) (uint, error) {
|
||||
var depth uint
|
||||
vol := rbdVolume{}
|
||||
|
Reference in New Issue
Block a user