-
Notifications
You must be signed in to change notification settings - Fork 370
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
Fix possible Antrea Agent crash in dualstack mode #4480
Conversation
@@ -75,15 +75,19 @@ func newFeaturePodConnectivity( | |||
if ipProtocol == binding.ProtocolIP { | |||
ctZones[ipProtocol] = CtZone | |||
gatewayIPs[ipProtocol] = nodeConfig.GatewayConfig.IPv4 | |||
nodeIPs[ipProtocol] = nodeConfig.NodeIPv4Addr.IP | |||
if nodeConfig.NodeIPv4Addr != 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.
Why do we have this case?
Codecov Report
@@ Coverage Diff @@
## main #4480 +/- ##
==========================================
+ Coverage 64.58% 68.42% +3.84%
==========================================
Files 390 400 +10
Lines 57640 58306 +666
==========================================
+ Hits 37225 39897 +2672
+ Misses 17760 15633 -2127
- Partials 2655 2776 +121
|
d1f5f13
to
60826ed
Compare
pkg/agent/config/node_config_test.go
Outdated
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
ipv4Enabled, err := IsIPv4Enabled(tt.nodeConfig, tt.trafficEncapMode) | ||
assert.Equal(t, tt.expectedErr, err) |
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.
use assert.EqualError
, or assert.ErrorContains
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.
Done
When a Cluster is dualstack, it assumes that every Node is configured with both IPv4 and IPv6 addresses for Antrea Agent. However, if a Node is only configured with either IPv4 or IPv6 address, Antrea Agent will get crashed. Signed-off-by: Hongliang Liu <[email protected]>
60826ed
to
9cf5b0f
Compare
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 |
/test-ipv6-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
/test-ipv6-e2e |
When a Cluster is dualstack, it assumes that every Node is configured with both IPv4 and IPv6 addresses for Antrea Agent. However, if a Node is only configured with either IPv4 or IPv6 address, Antrea Agent will get crashed.
Signed-off-by: Hongliang Liu [email protected]