From 8152bdf5e0615e3238a4763449e41b8d01ff6ebe Mon Sep 17 00:00:00 2001 From: xieyanker Date: Wed, 20 Jan 2021 15:04:18 +0800 Subject: [PATCH] Fix: wrong split in FindLoadbalancer function (cherry picked from commit 7d56483a3e76983a96eff5d894b3ad92df186c37) --- pkg/ovs/ovn-nbctl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ovs/ovn-nbctl.go b/pkg/ovs/ovn-nbctl.go index 7f13ea03fa6..d7e5327bafb 100644 --- a/pkg/ovs/ovn-nbctl.go +++ b/pkg/ovs/ovn-nbctl.go @@ -611,7 +611,7 @@ func (c Client) DeleteStaticRouteByNextHop(nextHop string) error { func (c Client) FindLoadbalancer(lb string) (string, error) { output, err := c.ovnNbCommand("--data=bare", "--no-heading", "--columns=_uuid", "find", "load_balancer", fmt.Sprintf("name=%s", lb)) - count := len(strings.Split(output, "/n")) + count := len(strings.Split(output, "\n")) if count > 1 { klog.Errorf("%s has %d lb entries", lb, count) return "", fmt.Errorf("%s has %d lb entries", lb, count)