-
Notifications
You must be signed in to change notification settings - Fork 373
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
Update Node's MAC address to the Node's annotation for direct routing #2161
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2161 +/- ##
==========================================
- Coverage 61.30% 61.18% -0.12%
==========================================
Files 273 273
Lines 20646 20658 +12
==========================================
- Hits 12656 12640 -16
- Misses 6688 6703 +15
- Partials 1302 1315 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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
/test-all |
@jianjuns @antoninbas I moved the MAC reporting to a platform generic function |
/test-all |
/test-all |
/test-all |
/test-networkpolicy |
/test-windows-conformance |
/test-e2e /test-conformance /test-networkpolicy |
@antoninbas @lzhecheng I rebased on main and added unit test for |
/test-all |
/test-all |
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
pkg/agent/agent_test.go
Outdated
expectedNodeConfig: config.NodeConfig{ | ||
Name: nodeName, | ||
OVSBridge: ovsBridge, | ||
DefaultTunName: defaultTunInterfaceName, | ||
PodIPv4CIDR: podCIDR, | ||
NodeIPAddr: nodeIPNet, | ||
NodeMTU: 1400, | ||
UplinkNetConfig: new(config.AdapterNetConfig), | ||
}, |
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: it seems that you could have a getExpectedNodeConfig
helper function with the expectedMTU
as a parameter to avoid repeating this? Don't feel strongly about it though.
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.
makes sense, changed to construct an expectedNodeConfig directly in t.Run
pkg/agent/agent_test.go
Outdated
TunnelType: tt.tunnelType, | ||
}, | ||
} | ||
assert.NoError(t, initializer.initNodeLocalConfig()) |
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: this should probably be a require
. If initNodeLocalConfig
fails, initializer.nodeConfig
could be nil
?
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.
Right, thanks for catching it
To bypass Windows host network when forwarding Pod egress traffic in noencap mode, antrea-agent needs to know peer Nodes' MAC addresses so that it can configure Openflow rules which route the packets to underlay network via uplink interface directly. To discover the MAC addresses, the PR makes each antrea-agent report its uplink's MAC address to the Node's annotation, then other agents can get it when the NodeRouteController configures route/flows to this Node. Signed-off-by: Quan Tian <qtian@vmware.com>
/test-all |
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
To bypass Windows host network when forwarding Pod egress traffic in noencap mode, antrea-agent needs to know peer Nodes' MAC addresses so that it can configure Openflow rules which route the packets to underlay network via uplink interface directly.
To discover the MAC addresses, the PR makes each antrea-agent report its uplink's MAC address to the Node's annotation, then other agents can get it when the NodeRouteController configures route/flows to this Node.
Signed-off-by: Quan Tian qtian@vmware.com
For #2157