Skip to content

Commit

Permalink
fix usage of ovn commands
Browse files Browse the repository at this point in the history
  • Loading branch information
chestack authored and oilbeater committed Mar 1, 2022
1 parent fe7a6e0 commit 7354d0c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/ovs/ovn-nbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,10 @@ func (c Client) UpdateNatRule(policy, logicalIP, externalIP, router, logicalMac,
_, err := c.ovnNbCommand(IfExists, "lr-nat-del", router, "snat", logicalIP)
return err
}
_, err := c.ovnNbCommand(IfExists, "lr-nat-del", router, "snat", logicalIP, "--",
"lr-nat-add", router, policy, externalIP, logicalIP)
if _, err := c.ovnNbCommand(IfExists, "lr-nat-del", router, "snat", logicalIP); err != nil {
return err
}
_, err := c.ovnNbCommand(MayExist, "lr-nat-add", router, policy, externalIP, logicalIP)
return err
} else {
output, err := c.ovnNbCommand("--format=csv", "--no-heading", "--data=bare", "--columns=external_ip", "find", "NAT", fmt.Sprintf("logical_ip=%s", logicalIP), "type=dnat_and_snat")
Expand Down

0 comments on commit 7354d0c

Please sign in to comment.