mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: implement rbdVolume.resize() with go-ceph
Replaced command execution with go-ceph Resize() function. Volsize is being updated before waiting for resize() to return, fixed it to get updated only after resize() is successful. Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
1eff20590d
commit
9ed0811422
@ -1090,13 +1090,12 @@ func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi
|
||||
nodeExpansion := false
|
||||
if rbdVol.VolSize < volSize {
|
||||
util.DebugLog(ctx, "rbd volume %s size is %v,resizing to %v", rbdVol, rbdVol.VolSize, volSize)
|
||||
rbdVol.VolSize = volSize
|
||||
nodeExpansion = true
|
||||
err = rbdVol.resize(ctx, cr)
|
||||
err = rbdVol.resize(volSize)
|
||||
if err != nil {
|
||||
klog.Errorf(util.Log(ctx, "failed to resize rbd image: %s with error: %v"), rbdVol, err)
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
nodeExpansion = true
|
||||
}
|
||||
|
||||
return &csi.ControllerExpandVolumeResponse{
|
||||
|
Reference in New Issue
Block a user