Skip to content
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

Merged
merged 1 commit into from
Apr 24, 2020

Conversation

timoreimann
Copy link
Collaborator

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.

The PR depends on #301.

@timoreimann timoreimann force-pushed the enable-and-support-testnodevolumeattachlimit branch from 125266b to 4ac8311 Compare April 23, 2020 10:01
@timoreimann timoreimann force-pushed the update-csi-test-to-digitalocean-csi-test-at-master branch from 22f9d65 to f0d2372 Compare April 23, 2020 19:10
@timoreimann timoreimann force-pushed the enable-and-support-testnodevolumeattachlimit branch from 4ac8311 to 5f38463 Compare April 23, 2020 19:44
@timoreimann timoreimann changed the base branch from update-csi-test-to-digitalocean-csi-test-at-master to master April 23, 2020 19:47
@timoreimann timoreimann force-pushed the enable-and-support-testnodevolumeattachlimit branch from 5f38463 to f203740 Compare April 23, 2020 21:16
Copy link
Contributor

@adamwg adamwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

return nil, resp, errors.New("droplet was not found")
}

if len(droplet.VolumeIDs) == maxVolumesPerNode {
Copy link
Contributor

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?

Copy link
Collaborator Author

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.
@timoreimann timoreimann force-pushed the enable-and-support-testnodevolumeattachlimit branch from f203740 to 98c12a8 Compare April 24, 2020 20:56
@timoreimann timoreimann merged commit e702cab into master Apr 24, 2020
@timoreimann timoreimann deleted the enable-and-support-testnodevolumeattachlimit branch April 24, 2020 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants