-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable tests for node volume attachment limits #303
Enable tests for node volume attachment limits #303
Conversation
125266b
to
4ac8311
Compare
22f9d65
to
f0d2372
Compare
4ac8311
to
5f38463
Compare
5f38463
to
f203740
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
driver/driver_test.go
Outdated
return nil, resp, errors.New("droplet was not found") | ||
} | ||
|
||
if len(droplet.VolumeIDs) == maxVolumesPerNode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use >= maxVolumesPerNode
here just to be safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, good call -- done.
The csi-test sanity package ships with off-by-default tests to validate per-node attachment limits. This change toggles the corresponding test configuration flag to enable the tests. The change requires modifying our fake driver to return a 422 HTTP error code when the limit is exceeded. As a consequence, we also need to customize the IdempotentCount test setting which parameterizes the 'should be idempotent' test that creates the given number of volumes in sequence. The default value of 10 causes our (fake) limit to be exceeded, which is why we tune it down to 5. The test also revealed that we missed to handle the case where the node volume attachment limit is exceed during ControllerPublishVolume. We extend our error handling to identify this case and return an RESOURCE_EXHAUSTED code accordingly.
f203740
to
98c12a8
Compare
The csi-test sanity package ships with off-by-default tests to validate per-node attachment limits. This change toggles the corresponding test configuration flag to enable the tests.
The change requires modifying our fake driver to return a 422 HTTP error code when the limit is exceeded. As a consequence, we also need to customize the IdempotentCount test setting which parameterizes the 'should be idempotent' test that creates the given number of volumes in
sequence. The default value of 10 causes our (fake) limit to be exceeded, which is why we tune it down to 5.
The test also revealed that we missed to handle the case where the node volume attachment limit is exceed during
ControllerPublishVolume
. We extend our error handling to identify this case and return anRESOURCE_EXHAUSTED
code accordingly.The PR depends on #301.