-
Notifications
You must be signed in to change notification settings - Fork 632
Fix local IP address depletion by cleaning up network bridges for aws… #4741
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
Conversation
04ab1b2
to
5d61c72
Compare
require.NoError(t, err) | ||
} | ||
|
||
func testManaedLinuxBranchENIConfiguration(t *testing.T) { |
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.
nit: Typo
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.
Pushed a new rev to fix this
@@ -36,6 +42,88 @@ const ( | |||
macAddress = "0a:1b:2c:3d:4e:5f" | |||
) | |||
|
|||
func TestManagedLinux_TestConfigureInterface(t *testing.T) { | |||
t.Run("regular-eni", testManagedLinuxRegularENIConfiguration) | |||
t.Run("branch-eni", testManaedLinuxBranchENIConfiguration) |
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.
nit: Typo
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.
Pushed a new rev to fix this
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.
Other than theses minor comments, changes LGTM. Will approve contingent on test passing and fix for the typo in test name.
case networkinterface.V2NInterfaceAssociationProtocol: | ||
err = m.common.configureGENEVEInterface(ctx, netNSPath, iface, netDAO) | ||
case networkinterface.VETHInterfaceAssociationProtocol: | ||
// Do nothing. |
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.
nit: can we have a comment about why?
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.
LGTM
Summary
Scope down IP address depletion fix to managed linux platform only.
Previously in #4717, we made the change to fix the IP address depletion issue (for managed linux platform). However, since the change was made in common_linux, it introduced bug in existing platforms. This change is to scope down the fix to only apply to the managed linux platform.
Implementation details
Instead of invoking the CNI clean-up logic in the common_linux code path, methods
configureRegularENI
andconfigureBranchENI
are created for the managed_linux platform, where we will use logic specific to managed linux platform, instead of using the common code path.Testing
Unit Test
New tests cover the changes: YES
Introduced new unit tests
TestManagedLinux_TestConfigureInterface/regular-eni
andTestManagedLinux_TestConfigureInterface/branch-eni
E2E Testing
Launched and stopped multiple tasks on the same host, then examined the CNI plugin log.
For task
8d919a758df041ba9f251e033275c961
, saw the following:Specifically, these 2 lines at the bottom prove that the fix to clean up netns kicked in:
Description for the changelog
Scope down IP address depletion fix to managed linux platform only.
Additional Information
Does this PR include breaking model changes? If so, Have you added transformation functions?
NO
Does this PR include the addition of new environment variables in the README?
NO
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.