Skip to content

Commit

Permalink
controller: skip VIP gc if LB not found
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Jul 18, 2023
1 parent 494209d commit d583ea9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/controller/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,15 @@ func (c *Controller) gcLoadBalancer() error {
return nil
}

lb, err := c.ovnClient.GetLoadBalancer(lbName, false)
lb, err := c.ovnClient.GetLoadBalancer(lbName, true)
if err != nil {
klog.Errorf("get LB %s: %v", lbName, err)
return err
}
if lb == nil {
klog.Infof("load balancer %q not found", lbName)
return nil
}

for vip := range lb.Vips {
if !svcVips.Has(vip) {
Expand Down

0 comments on commit d583ea9

Please sign in to comment.