Skip to content

Commit

Permalink
feat(csi-driver): trim 10MiB off the required_bytes
Browse files Browse the repository at this point in the history
When processing the NodeExpandVolume CSI call, we compare the sysfs size
of the volume nexus against the requested capacity. Shaving 10MiB off the
requested capacity puts the number in the ballpark range of the capacity
we expect from the nexus after the ControllerExpandVolume has expanded it.

Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
  • Loading branch information
niladrih committed Mar 1, 2024
1 parent afce276 commit 4f5f206
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion control-plane/csi-driver/src/bin/node/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ impl node_server::Node for Node {
// down by 5 MiB so that the capacity of the device is verified to be greater than or
// equal to this corrected capacity. This is required because we are not comparing the
// required capacity against the REST API Volume resource.
const MAX_NEXUS_CAPACITY_DIFFERENCE: i64 = 5 * 1024 * 1024;
const MAX_NEXUS_CAPACITY_DIFFERENCE: i64 = 10 * 1024 * 1024;
// Ensure device_capacity is greater than or equal to required_bytes.
if device_capacity < (required_bytes - MAX_NEXUS_CAPACITY_DIFFERENCE) {
return Err(failure!(
Expand Down

0 comments on commit 4f5f206

Please sign in to comment.