Skip to content

Commit

Permalink
fix: delete lb if it has no backend
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Feb 13, 2020
1 parent d6c9363 commit 44d53c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ovs/ovn-nbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (c Client) addLoadBalancerToLogicalSwitch(lb, ls string) error {
func (c Client) DeleteLoadBalancerVip(vip, lb string) error {
existVips, err := c.GetLoadBalancerVips(lb)
// vip is empty or delete last rule will destroy the loadbalancer
if vip == "" || len(existVips) == 1 || existVips[vip] == "" {
if vip == "" || len(existVips) == 1 {
return nil
}
_, err = c.ovnNbCommand(IfExists, "lb-del", lb, vip)
Expand Down

0 comments on commit 44d53c2

Please sign in to comment.