You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnnil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume error when getting size of block volume at path %s: %v", devicePath, err))
407
+
}
408
+
ifgotBlockSizeBytes<reqBytes {
409
+
// It's possible that the somewhere the volume size was rounded up, getting more size than requested is a success :)
410
+
returnnil, status.Errorf(codes.Internal, "ControllerExpandVolume resize requested for %v but after resize volume was size %v", reqBytes, gotBlockSizeBytes)
411
+
}
412
+
413
+
// TODO(dyzz) Some sort of formatted volume could also check the fs size.
414
+
// Issue is that we don't know how to account for filesystem overhead, it
415
+
// could be proportional to fs size and different for xfs, ext4 and we don't
416
+
// know the proportions
417
+
418
+
/*
419
+
format, err := ns.Mounter.GetDiskFormat(devicePath)
420
+
if err != nil {
421
+
return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume error checking format for device %s: %v", devicePath, err))
422
+
}
423
+
gotSizeBytes, err = ns.getFSSizeBytes(devicePath)
424
+
425
+
if err != nil {
426
+
return nil, status.Errorf(codes.Internal, "ControllerExpandVolume resize could not get fs size of %s: %v", volumePath, err)
427
+
}
428
+
if gotSizeBytes != reqBytes {
429
+
return nil, status.Errorf(codes.Internal, "ControllerExpandVolume resize requested for size %v but after resize volume was size %v", reqBytes, gotSizeBytes)
0 commit comments