Closed guilhem closed 2 days ago
@guilhem - do you intend to re-open https://github.com/linode/linode-blockstorage-csi-driver/pull/310? I believe those changes will still be beneficial in order to properly implement the CSI spec and behave the way that kube-scheduler expects.
@wbh1 totally. Was on draft just for discussion. I'm opening it off team is interested
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 74.79%. Comparing base (
8df2d46
) to head (6f49ca5
). Report is 2 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
duplicate #322
This pull request focuses on simplifying the volume attachment logic in the
ControllerServer
by removing redundant checks and related methods. The most important changes include the removal of thecheckAttachmentCapacity
function and its associated methods, as well as the related test cases.Context
CSI caller (like Kubernetes) should already respect volume limitation from
NodeGetInfo
. We don't need another check and logic at attach.Motivation
Reduce logic and complexity and rely more on Linode API calls. If there is an error, return it to the user for easier debug.
Risk
Making more failing attach requests and maybe hitting a rate limit. This should not be a problem, as CSI attacher have a backoff logic. Moreover, current limit logic is already doing api calls that should have hit API ratelimit.
Possible Mitigations
csiErrorBackoff
mechanismIMHO, both are not mandatory for the moment.
Simplification of volume attachment logic:
checkAttachmentCapacity
function and its invocation from theControllerPublishVolume
method ininternal/driver/controllerserver.go
.canAttach
function, which was used to determine if an additional volume could be attached to an instance, frominternal/driver/controllerserver_helper.go
.checkAttachmentCapacity
function, which checked if an instance could accommodate additional volume attachments, frominternal/driver/controllerserver_helper.go
.Removal of related test cases:
TestCheckAttachmentCapacity
test function frominternal/driver/controllerserver_helper_test.go
, which tested thecheckAttachmentCapacity
logic.General:
Pull Request Guidelines: