rbd: implement NodeReclaimSpace

By calling fstrim/blkdiscard on the volume, space consumption should get
reduced.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos
2021-12-20 10:29:40 +01:00
committed by mergify[bot]
parent 7d36c5a9d1
commit c274649b80
2 changed files with 92 additions and 0 deletions

View File

@ -41,3 +41,22 @@ func TestControllerReclaimSpace(t *testing.T) {
_, err := controller.ControllerReclaimSpace(context.TODO(), req)
assert.Error(t, err)
}
// TestNodeReclaimSpace is a minimal test for the NodeReclaimSpace() procedure.
// During unit-testing, there is no Ceph cluster available, so actual
// operations can not be performed.
func TestNodeReclaimSpace(t *testing.T) {
t.Parallel()
node := NewReclaimSpaceNodeServer()
req := &rs.NodeReclaimSpaceRequest{
VolumeId: "",
VolumePath: "",
VolumeCapability: nil,
Secrets: nil,
}
_, err := node.NodeReclaimSpace(context.TODO(), req)
assert.Error(t, err)
}