Skip to content

Commit

Permalink
fix: lr-route for eip using nic-ip, and not external gateway addr.
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldin95 committed May 7, 2021
1 parent f5bd405 commit 41226d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,9 @@ func (c *Controller) handleUpdatePod(key string) error {
return fmt.Errorf("no available gateway nic address")
}
nextHop = strings.Split(nextHop, "/")[0]
if addr := cm.Data["external-gw-addr"]; addr != "" {
nextHop = addr
}

if err := c.ovnClient.AddStaticRoute(ovs.PolicySrcIP, podIP, nextHop, c.config.ClusterRouter, util.NormalRouteType); err != nil {
klog.Errorf("failed to add static route, %v", err)
Expand Down

0 comments on commit 41226d8

Please sign in to comment.