From 839842bb909260458291f702115e4a867e4a38e5 Mon Sep 17 00:00:00 2001 From: Nadia Pinaeva Date: Fri, 20 Sep 2024 11:59:10 +0200 Subject: [PATCH] Cleanup gateway pod for remote zone. For local zone pods, deleteLogicalPort cleans this up, but before IC this function was called for all non-host-network pods, hence this logic. After IC, deleteLogicalPort won't be called for all remote zone pods, so condition is not needed. Signed-off-by: Nadia Pinaeva --- go-controller/pkg/ovn/ovn.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/go-controller/pkg/ovn/ovn.go b/go-controller/pkg/ovn/ovn.go index d7dd870ee4..0f1ffdc668 100644 --- a/go-controller/pkg/ovn/ovn.go +++ b/go-controller/pkg/ovn/ovn.go @@ -277,12 +277,10 @@ func (oc *DefaultNetworkController) removeLocalZonePod(pod *kapi.Pod, portInfo * // It removes the remote pod ips from the namespace address set and if its an external gw pod, removes // its routes. func (oc *DefaultNetworkController) removeRemoteZonePod(pod *kapi.Pod) error { - if util.PodWantsHostNetwork(pod) { - // Delete the routes in the namespace associated with this remote pod if it was acting as an external GW - if err := oc.deletePodExternalGW(pod); err != nil { - return fmt.Errorf("unable to delete external gateway routes for remote pod %s: %w", - getPodNamespacedName(pod), err) - } + // Delete the routes in the namespace associated with this remote pod if it was acting as an external GW + if err := oc.deletePodExternalGW(pod); err != nil { + return fmt.Errorf("unable to delete external gateway routes for remote pod %s: %w", + getPodNamespacedName(pod), err) } // while this check is only intended for local pods, we also need it for