Skip to content

Commit

Permalink
refactor: remove duplicated call
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Feb 4, 2021
1 parent d289aa9 commit f6f8850
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (c *Controller) handleUpdateEndpoint(key string) error {
if port.Protocol == v1.ProtocolTCP {
// for performance reason delete lb with no backends
if len(backends) > 0 {
err = c.ovnClient.CreateLoadBalancerRule(tcpLb, vip, getServicePortBackends(ep, port, clusterIP), string(port.Protocol))
err = c.ovnClient.CreateLoadBalancerRule(tcpLb, vip, backends, string(port.Protocol))
if err != nil {
klog.Errorf("failed to update vip %s to tcp lb, %v", vip, err)
return err
Expand All @@ -148,7 +148,7 @@ func (c *Controller) handleUpdateEndpoint(key string) error {
}
} else {
if len(backends) > 0 {
err = c.ovnClient.CreateLoadBalancerRule(udpLb, vip, getServicePortBackends(ep, port, clusterIP), string(port.Protocol))
err = c.ovnClient.CreateLoadBalancerRule(udpLb, vip, backends, string(port.Protocol))
if err != nil {
klog.Errorf("failed to update vip %s to udp lb, %v", vip, err)
return err
Expand Down

0 comments on commit f6f8850

Please sign in to comment.