From 2ba3b8e54cd06bc3b66c029d31ba9a8744fd4f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A5=96=E5=BB=BA?= Date: Wed, 19 Jul 2023 12:34:32 +0800 Subject: [PATCH] controller: skip VIP gc if LB not found (#3048) --- pkg/controller/gc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/controller/gc.go b/pkg/controller/gc.go index 327eb82c1c5..e80817b7f7e 100644 --- a/pkg/controller/gc.go +++ b/pkg/controller/gc.go @@ -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) {