Skip to content

Commit

Permalink
Fix: wrong split in FindLoadbalancer function
Browse files Browse the repository at this point in the history
(cherry picked from commit 7d56483)
  • Loading branch information
xieyanker authored and oilbeater committed Mar 9, 2021
1 parent 33b0e18 commit 8152bdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ovs/ovn-nbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8152bdf

Please sign in to comment.