-
Notifications
You must be signed in to change notification settings - Fork 363
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 antrea-agent crashing in networkPolicyOnly mode #795
Conversation
Thanks for your PR. The following commands are available:
These commands can only be run by members of the vmware-tanzu organization. |
/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.
Fix LGTM
return ipNet | ||
} | ||
|
||
func TestAgentQuerierGetAgentInfo(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.
@tnqn is this test related to this PR?
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.
Yes, AgentQuerier.GetAgentInfo
is the method panic. The test ensures it can get expected result without panic (networkPolicyOnly-mode non-partial case).
pkg/agent/agent.go
Outdated
@@ -503,7 +503,7 @@ func (i *Initializer) initNodeLocalConfig() error { | |||
} | |||
|
|||
if i.networkConfig.TrafficEncapMode.IsNetworkPolicyOnly() { | |||
i.nodeConfig = &config.NodeConfig{Name: nodeName, NodeIPAddr: localAddr, BridgeName: i.ovsBridgeClient.GetBridgeName(), UplinkNetConfig: new(config.AdapterNetConfig)} | |||
i.nodeConfig = &config.NodeConfig{Name: nodeName, NodeIPAddr: localAddr, 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.
Add OVSBridge?
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.
Good catch! This must have caused some issues in networkPolicyOnly mode too.
The PodCIDR of NodeConfig could be nil for the networkPolicyOnly trafficEncapMode. The AgentQuerier should check nil before converting it to string. Besides, this patch removes the redundant field BridgeName and fixes a 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.
LGTM
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. Having offline discussion with @ruicao93 , the field is not used on Windows. It is OK to delete it.
/test-all |
The PodCIDR of NodeConfig could be nil for the networkPolicyOnly trafficEncapMode. The AgentQuerier should check nil before converting it to string. Besides, this patch removes the redundant field BridgeName and fixes a typo.
The PodCIDR of NodeConfig could be nil for the networkPolicyOnly trafficEncapMode. The AgentQuerier should check nil before converting it to string. Besides, this patch removes the redundant field BridgeName and fixes a typo.
The PodCIDR of NodeConfig could be nil for the networkPolicyOnly trafficEncapMode. The AgentQuerier should check nil before converting it to string. Besides, this patch removes the redundant field BridgeName and fixes a typo.
The PodCIDR of NodeConfig could be nil for the networkPolicyOnly
trafficEncapMode. The AgentQuerier should check nil before converting it
to string.
Besides, this patch removes the redundant field BridgeName and fixes a
typo.
Fixes #793