From af45983416fb651099ac1f12d7aa8e9772bb2eeb Mon Sep 17 00:00:00 2001 From: Vishal Thapar <5137689+vthapar@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:08:14 +0530 Subject: [PATCH] Upgrade changes for OVN IC When a submariner installation upgrades from legacy non-OVN-IC version to an OVN-IC version, cleanup resources created by legacy installation. Fixes https://github.com/submariner-io/enhancements/issues/193 Signed-off-by: Vishal Thapar <5137689+vthapar@users.noreply.github.com> --- pkg/routeagent_driver/handlers/ovn/handler.go | 2 ++ pkg/routeagent_driver/handlers/ovn/vsctl/vsctl.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/routeagent_driver/handlers/ovn/handler.go b/pkg/routeagent_driver/handlers/ovn/handler.go index ae912dd73..4c563e891 100644 --- a/pkg/routeagent_driver/handlers/ovn/handler.go +++ b/pkg/routeagent_driver/handlers/ovn/handler.go @@ -88,6 +88,8 @@ func (ovn *Handler) GetNetworkPlugins() []string { } func (ovn *Handler) Init() error { + ovn.LegacyCleanup() + err := ovn.initIPtablesChains() if err != nil { return err diff --git a/pkg/routeagent_driver/handlers/ovn/vsctl/vsctl.go b/pkg/routeagent_driver/handlers/ovn/vsctl/vsctl.go index 4c7b29f21..2ba8b3483 100644 --- a/pkg/routeagent_driver/handlers/ovn/vsctl/vsctl.go +++ b/pkg/routeagent_driver/handlers/ovn/vsctl/vsctl.go @@ -65,7 +65,7 @@ func AddBridge(bridgeName string) error { } func DelBridge(bridgeName string) error { - _, err := vsctlCmd("del-br", bridgeName) + _, err := vsctlCmd("--if-exists", "del-br", bridgeName) return err }