-
Notifications
You must be signed in to change notification settings - Fork 742
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
Explicitly set the IP on secondary ENIs #271
Conversation
@ewbankkit found issue when i did restart for aws-node pods L-IPAMD failed to start with error below:
|
@md2k Thanks - I guess I'll need to add check for existing address on the device. |
If I blindly just don't add the address on restart then the routes fail to add:
|
Deleting any existing address on the secondary ENI and then adding it again works:
|
Verified that it also works as expected on stock Ubuntu 16.04: $ uname -r
4.4.0-1073-aws
|
Set netmask equal to subnet's netmask. Check for existing IP on secondary ENI before adding. Attempt to fix unit tests.
I can't seem to get the unit tests to pass.
|
pkg/networkutils/network.go
Outdated
// ip add del <eniIP> dev <link> (if necessary) | ||
// ip add add <eniIP> dev <link> | ||
log.Debugf("Setting up ENI's primary IP %s", eniIP) | ||
addrs, err := netlink.AddrList(link, unix.AF_INET) |
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.
s/netlink/netLink/g
- (Please replace l
with L
.)
Then, netLink.AddrList()
calls wrapper library and mockNetLink.EXPECT().AddrList
in unit test will be called as you expected.
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.
replace with
addrs, err := netLink.AddrList(link, unix.AF_INET),
unit-test should pass
LGTM if you fixed the unit-test failure |
@nak3 / @liwenwu-amazon Thanks for the tip; Unit tests are now passing. |
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.
Thanks!
Fixes #219.
Verified on Amazon Linux 2 and stock CentOS 7.