mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
rbd: resize the volume created from volume
If the requested volume size is greater than the parent volume size, resize the cloned volume after creating a final clone from a parent volume. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
f7f662678a
commit
a28a4a4285
@ -181,6 +181,14 @@ func (rv *rbdVolume) createCloneFromImage(ctx context.Context, parentVol *rbdVol
|
||||
return err
|
||||
}
|
||||
|
||||
// expand the image if the requested size is greater than the current size
|
||||
err = rv.expand()
|
||||
if err != nil {
|
||||
log.ErrorLog(ctx, "failed to resize volume %s: %v", rv, err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user