-
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
Restore NO_FLOOD to OVS ports after reconnecting the OVS bridge #4654
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4654 +/- ##
==========================================
- Coverage 69.86% 69.57% -0.30%
==========================================
Files 403 402 -1
Lines 59778 58421 -1357
==========================================
- Hits 41765 40644 -1121
+ Misses 15189 14975 -214
+ Partials 2824 2802 -22
*This pull request uses carry forward flags. Click here to find out more.
|
d35922c
to
23f835a
Compare
/test-all |
23f835a
to
383a006
Compare
pkg/agent/agent.go
Outdated
} else { | ||
klog.InfoS("Set port no-flood success", "PortName", port.Name) | ||
} |
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.
} else { | |
klog.InfoS("Set port no-flood success", "PortName", port.Name) | |
} | |
} | |
klog.InfoS("Set port no-flood successfully", "PortName", port.Name) | |
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.
Fixed. Thanks!
pkg/agent/agent.go
Outdated
klog.Info("Restoring OF port configs to OVS bridge") | ||
err := i.restorePortConfigs() | ||
if err != nil { | ||
klog.ErrorS(err, "Failed to restore OF port configs") | ||
} else { | ||
klog.Info("Restore OF port configs completed") | ||
} |
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.
klog.Info("Restoring OF port configs to OVS bridge") | |
err := i.restorePortConfigs() | |
if err != nil { | |
klog.ErrorS(err, "Failed to restore OF port configs") | |
} else { | |
klog.Info("Restore OF port configs completed") | |
} | |
klog.InfoS("Restoring OF port configs to OVS bridge") | |
if err := i.restorePortConfigs(); err != nil { | |
klog.ErrorS(err, "Failed to restore OF port configs") | |
} else { | |
klog.InfoS("Port configs restoration completed") | |
} |
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.
Fixed. Thanks!
@@ -655,7 +655,6 @@ func getPodCIDRsOnNode(node *corev1.Node) []string { | |||
func (c *Controller) createIPSecTunnelPort(nodeName string, nodeIP net.IP) (int32, error) { | |||
portName := util.GenerateNodeTunnelInterfaceName(nodeName) | |||
interfaceConfig, exists := c.interfaceStore.GetNodeTunnelInterface(nodeName) | |||
|
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.
Revert 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.
Done. Thanks!
6a528dc
to
8f29ecb
Compare
pkg/agent/agent.go
Outdated
ovsCtlClient := ovsctl.NewClient(i.ovsBridge) | ||
ovsPorts, err := i.ovsBridgeClient.GetPortList() | ||
if err != nil { | ||
return fmt.Errorf("failed to list OVS ports: %w", err) | ||
} | ||
for _, port := range ovsPorts { |
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.
don't we already cache all TrafficControl and IPSec interfaces? I think they can be fetched via GetInterfacesByType
more efficiently?
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. Thanks for the suggestion!
@@ -714,6 +717,10 @@ func (c *Controller) createIPSecTunnelPort(nodeName string, nodeIP net.IP) (int3 | |||
// Let NodeRouteController retry at errors. | |||
return 0, fmt.Errorf("failed to get of_port of IPsec tunnel port for Node %s", nodeName) | |||
} | |||
// Set external_ids to the port for upgrade case. | |||
if err := c.ovsBridgeClient.SetPortExternalIDs(portName, ovsExternalIDs); err != 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.
initInterfaceStore has a logic to fill missed AntreaInterfaceTypeKey, I think this could be moved there to unify the logic.
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. Thanks!
pkg/agent/interfacestore/types.go
Outdated
@@ -43,6 +43,7 @@ const ( | |||
AntreaUplink = "uplink" | |||
AntreaHost = "host" | |||
AntreaTrafficControl = "traffic-control" | |||
AntreaIPsec = "ipsec" |
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.
perhaps ipsec-tunnel to be more specific.
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.
d2472a2
to
35afabf
Compare
/test-all |
35afabf
to
161f575
Compare
The NO_FLOOD configuration is lost when the OVS daemon is restarted. Currently, the only way to recover this configuration is by restarting the agent. This pull request adds logic to recover the configuration when receiving OVS reconnection events. Signed-off-by: Xu Liu <[email protected]>
161f575
to
fe02848
Compare
/test-e2e |
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
/skip-e2e |
/skip-conformance its failure is because the tested svc IP which was supposed to be unreachable happened to be a real server IP. |
…ea-io#4654) The NO_FLOOD configuration is lost when the OVS daemon is restarted. Currently, the only way to recover this configuration is by restarting the agent. This pull request adds logic to recover the configuration when receiving OVS reconnection events. Signed-off-by: Xu Liu <[email protected]>
The NO_FLOOD configuration is lost when the OVS daemon is restarted. Currently, the only way to recover this configuration is by restarting the agent. This pull request adds logic to recover the configuration when receiving OVS reconnection events.