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

Wait for ENI and secondary IPs #1174

Merged
merged 1 commit into from
Aug 26, 2020
Merged

Wait for ENI and secondary IPs #1174

merged 1 commit into from
Aug 26, 2020

Conversation

mogren
Copy link
Contributor

@mogren mogren commented Aug 26, 2020

Issue #, if available:
#989, #1148

Description of changes:

The log statements helping us find #989 were added earlier this year in #909 and #939, but the issue has probably been there longer. The problem is detailed in #1148, we need to wait for the Secondary IPv4 addresses to show up in the EC2 response. This PR does the following:

  • Move waitENIAttached() from ipamd.go to awsutils.go
  • Added an additional argument for how many secondary IPs to wait for
  • Use retry with backoff instead of for-loop with sleep.
  • If we find at least 1 secondary IP, but less than we wanted, we don't return an error, but count it as a partial success
  • Added unit tests

(Replacing #1131 with a new PR)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mogren
Copy link
Contributor Author

mogren commented Aug 26, 2020

Integration tests passed https://app.circleci.com/pipelines/github/mogren/amazon-vpc-cni-k8s/726/workflows/243c1da5-ab60-423f-8692-ba5edca888b4/jobs/1454

pkg/awsutils/awsutils.go Outdated Show resolved Hide resolved
When a newly created ENI gets attached, we should wait for the
secondary IPv4 addresses to be assigned to the ENI before continuing.
Copy link
Contributor

@jayanthvn jayanthvn left a comment

Choose a reason for hiding this comment

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

Looks good :)

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.

2 participants