mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
cephfs: resize cloned, restored volume if required
Currently, as a workaround, we are calling the resize volume on the cloned, restore volumes to adjust the cloned, restored volumes. With this fix, we are calling the resize volume only if there is a size mismatch with requested and the volume from which the new volume needs to be created. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
0bd1d44dc0
commit
ef14ea7723
@ -211,11 +211,7 @@ func (cs *ControllerServer) CreateVolume(
|
||||
|
||||
if vID != nil {
|
||||
if sID != nil || pvID != nil {
|
||||
// while cloning the volume the size is not populated properly to the new volume now.
|
||||
// it will be fixed in cephfs soon with the parentvolume size. Till then by below
|
||||
// resize we are making sure we return or satisfy the requested size by setting the size
|
||||
// explicitly
|
||||
err = volOptions.ResizeVolume(ctx, fsutil.VolumeID(vID.FsSubvolName), volOptions.Size)
|
||||
err = volOptions.ExpandVolume(ctx, fsutil.VolumeID(vID.FsSubvolName), volOptions.Size)
|
||||
if err != nil {
|
||||
purgeErr := volOptions.PurgeVolume(ctx, fsutil.VolumeID(vID.FsSubvolName), false)
|
||||
if purgeErr != nil {
|
||||
@ -235,6 +231,7 @@ func (cs *ControllerServer) CreateVolume(
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
volumeContext := req.GetParameters()
|
||||
volumeContext["subvolumeName"] = vID.FsSubvolName
|
||||
volumeContext["subvolumePath"] = volOptions.RootPath
|
||||
|
Reference in New Issue
Block a user