From d583ea9d23c364b9693a1c0cd0191b4a517811c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A5=96=E5=BB=BA?= Date: Tue, 18 Jul 2023 16:49:12 +0800 Subject: [PATCH] controller: skip VIP gc if LB not found --- 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) {