Skip to content

Commit d444742

Browse files
committed
fix: unnecessary resize volume error
1 parent e6ab652 commit d444742

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/os/volume/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ func (VolumeAPI) ResizeVolume(volumeID string, size int64) error {
197197
return fmt.Errorf("error getting the current size of volume (%s) with error (%v)", volumeID, err)
198198
}
199199

200-
//if the partition's size is already the size we want this is a noop, just return
201-
if currentSize >= finalSize {
200+
// only resize if finalSize - currentSize is greater than 100MB
201+
if finalSize-currentSize < 100*1024*1024 {
202202
klog.V(2).Infof("Attempted to resize volume %s to a lower size, from currentBytes=%d wantedBytes=%d", volumeID, currentSize, finalSize)
203203
return nil
204204
}

0 commit comments

Comments
 (0)