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
| } else { | ||
| klog.InfoS("Set port no-flood success", "PortName", port.Name) | ||
| } |
There was a problem hiding this comment.
| } else { | |
| klog.InfoS("Set port no-flood success", "PortName", port.Name) | |
| } | |
| } | |
| klog.InfoS("Set port no-flood successfully", "PortName", port.Name) | |
| 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.
| 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") | |
| } |
| func (c *Controller) createIPSecTunnelPort(nodeName string, nodeIP net.IP) (int32, error) { | ||
| portName := util.GenerateNodeTunnelInterfaceName(nodeName) | ||
| interfaceConfig, exists := c.interfaceStore.GetNodeTunnelInterface(nodeName) | ||
|
|
6a528dc to
8f29ecb
Compare
| 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.
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.
Done. Thanks for the suggestion!
| 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.
initInterfaceStore has a logic to fill missed AntreaInterfaceTypeKey, I think this could be moved there to unify the logic.
| AntreaUplink = "uplink" | ||
| AntreaHost = "host" | ||
| AntreaTrafficControl = "traffic-control" | ||
| AntreaIPsec = "ipsec" |
There was a problem hiding this comment.
perhaps ipsec-tunnel to be more specific.
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 <xliu2@vmware.com>
161f575 to
fe02848
Compare
|
/test-e2e |
|
/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 <xliu2@vmware.com>
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.