Fix bug that was preventing btrfs filesystems from being resized
This commit is contained in:
parent
d203eba5a9
commit
5dc8afc0a6
4
bd2fs.py
4
bd2fs.py
@ -146,8 +146,10 @@ class Bd2FsNodeServicer(csi_pb2_grpc.NodeServicer):
|
|||||||
# > The staging_target_path field is not required, for backwards compatibility, but the CO SHOULD supply it.
|
# > The staging_target_path field is not required, for backwards compatibility, but the CO SHOULD supply it.
|
||||||
# Apparently, k8s 1.18 does not supply it. So:
|
# Apparently, k8s 1.18 does not supply it. So:
|
||||||
dev_path = mountpoint_to_dev(request.volume_path)
|
dev_path = mountpoint_to_dev(request.volume_path)
|
||||||
|
volume_path = request.volume_path
|
||||||
if dev_path is None:
|
if dev_path is None:
|
||||||
dev_path = f"{request.volume_path}/device"
|
dev_path = f"{request.volume_path}/device"
|
||||||
|
volume_path = f"{request.volume_path}/mount"
|
||||||
|
|
||||||
bd_request = NodeExpandVolumeRequest()
|
bd_request = NodeExpandVolumeRequest()
|
||||||
bd_request.CopyFrom(request)
|
bd_request.CopyFrom(request)
|
||||||
@ -160,7 +162,7 @@ class Bd2FsNodeServicer(csi_pb2_grpc.NodeServicer):
|
|||||||
# > node expansion.
|
# > node expansion.
|
||||||
# Apparently k8s 1.18 omits this field.
|
# Apparently k8s 1.18 omits this field.
|
||||||
fs_type = current_fs(bd_request.volume_path)
|
fs_type = current_fs(bd_request.volume_path)
|
||||||
be_fs_expanded(fs_type, bd_request.volume_path, request.volume_path)
|
be_fs_expanded(fs_type, bd_request.volume_path, volume_path)
|
||||||
|
|
||||||
size = request.capacity_range.required_bytes
|
size = request.capacity_range.required_bytes
|
||||||
return csi_pb2.NodeExpandVolumeResponse(capacity_bytes=size)
|
return csi_pb2.NodeExpandVolumeResponse(capacity_bytes=size)
|
||||||
|
Loading…
Reference in New Issue
Block a user