Skip to content

Commit

Permalink
Cleanup gateway pod for remote zone.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
npinaeva committed Sep 20, 2024
1 parent 4b9c42b commit 839842b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions go-controller/pkg/ovn/ovn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 839842b

Please sign in to comment.