Skip to content

Commit

Permalink
fix: ip prefix might be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Mar 25, 2020
1 parent d15a5e2 commit 9032ac8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/ovs/ovn-nbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ func (c Client) DeleteStaticRouteByNextHop(nextHop string) error {
}
ipPrefixes := strings.Split(output, "\n")
for _, ipPre := range ipPrefixes {
if strings.TrimSpace(ipPre) == "" {
continue
}
if err := c.DeleteStaticRoute(ipPre, c.ClusterRouter); err != nil {
klog.Errorf("failed to delete route %s, %v", ipPre, err)
return err
Expand Down

0 comments on commit 9032ac8

Please sign in to comment.