From 08b95e747bd96d054a2ffd4371a0f0e7328de062 Mon Sep 17 00:00:00 2001 From: Mengxin Liu Date: Tue, 2 Mar 2021 17:00:56 +0800 Subject: [PATCH] fix: gc not exist node error ```bash failed to list static route , ovn-nbctl: nexthop=: argument does not end in ... followed by a value ``` --- pkg/ovs/ovn-nbctl.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/ovs/ovn-nbctl.go b/pkg/ovs/ovn-nbctl.go index 8a2b480551c..1a0b92250ee 100644 --- a/pkg/ovs/ovn-nbctl.go +++ b/pkg/ovs/ovn-nbctl.go @@ -589,6 +589,9 @@ func (c Client) DeleteStaticRoute(cidr, router string) error { } func (c Client) DeleteStaticRouteByNextHop(nextHop string) error { + if nextHop == "" { + return nil + } output, err := c.ovnNbCommand("--format=csv", "--no-heading", "--data=bare", "--columns=ip_prefix", "find", "Logical_Router_Static_Route", fmt.Sprintf("nexthop=%s", nextHop)) if err != nil { klog.Errorf("failed to list static route %s, %v", nextHop, err)