linode / linode-blockstorage-csi-driver

Container Storage Interface (CSI) Driver for Linode Block Storage
Apache License 2.0
64 stars 54 forks source link

internal/driver: Fix off-by-one error with max volume attachments #184

Closed nesv closed 2 months ago

nesv commented 2 months ago

When calculating the maximum number of allowed volume attachments, the code was previously taking the ideal maximum number of volumes that could be attached to a node. The way the attachment was calculated, it treated instance disks the same as volumes, which is not correct.

This commit fixes what is effectively an off-by-one error, by subtracting the number of instance disks from the theoretical maximum number of block devices that can be attached to the instance.

In other words, controller and node servers will now report the number of block storage volumes that can be attached, not just block devices.

Fixes #182

nesv commented 2 months ago

Squashed fixup commits.

nesv commented 2 months ago

Squashed fixup commits (again).