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

Add non-negative check on getVolumeLimit() #1542

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

gtxu
Copy link
Contributor

@gtxu gtxu commented Mar 22, 2023

Is this a bug fix or adding new feature?
Fix #1361
What is this PR about? / Why do we need it?
When volume attach limit not correct calculated, it may return negative value which is not allowed in the csi/spec
The -1 return in the issue reflect to metadata_ec2.go, when all available volume attached, the ENI turns to be actually ENI +1 for Nitro instances.

Reproduce the issue
On a cluster with aws-ebs-csi-driver installed,

  1. create a nitro instance node
  2. schedule pods with pvc to the node till reach/or exceed the attach limit
  3. restart aws-ebs-csi-driver
  4. check kubectl log, find the same error message as the issue Invalid attach limit value -1 cannot be added to CSINode object for "ebs.csi.aws.com" #1361

What testing is done?
Unit test added for maximum volume/eni allocated cases
CI test passed

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 22, 2023
@k8s-ci-robot k8s-ci-robot requested review from rdpsin and torredil March 22, 2023 02:54
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 22, 2023
@gtxu
Copy link
Contributor Author

gtxu commented Mar 22, 2023

/test all

@gtxu gtxu requested review from ConnorJC3 and removed request for rdpsin March 22, 2023 09:51
Copy link
Member

@torredil torredil left a comment

Choose a reason for hiding this comment

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

@gtxu
Copy link
Contributor Author

gtxu commented Mar 22, 2023

Adding reproducible example and test cases for the change. Thanks for the feedback folks!

Signed-off-by: Gengtao Xu <gengtaox@amazon.com>
@gtxu gtxu force-pushed the volme_attach_count branch from 35ae236 to f66f30a Compare March 22, 2023 18:47
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 22, 2023
@ConnorJC3
Copy link
Contributor

/lgtm

👍

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 22, 2023
@gtxu gtxu marked this pull request as ready for review March 22, 2023 20:05
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 22, 2023
@torredil
Copy link
Member

/lgtm

@ConnorJC3
Copy link
Contributor

/hold need to test this on Windows, might expose an existing bug

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 23, 2023
@ConnorJC3
Copy link
Contributor

/remove-hold
All good

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 23, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hanyuel, torredil

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 23, 2023
@k8s-ci-robot k8s-ci-robot merged commit 5d75bf4 into kubernetes-sigs:master Mar 23, 2023
@gtxu gtxu deleted the volme_attach_count branch April 20, 2023 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid attach limit value -1 cannot be added to CSINode object for "ebs.csi.aws.com"
5 participants