Explicitly set the IP on secondary ENIs#271
Explicitly set the IP on secondary ENIs#271mogren merged 2 commits intoaws:masterfrom ewbankkit:issue-219
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.
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.
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. |
Fixes #219.
Verified on Amazon Linux 2 and stock CentOS 7.