Commit 8ace8975 authored by Brad Davidson's avatar Brad Davidson Committed by Brad Davidson

Don't start up multiple apiserver load balancers

get() is called in a loop until client configuration is successfully retrieved. Each iteration will try to configure the apiserver proxy, which will in turn create a new load balancer. Skip creating a new load balancer if we already have one. Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com>
parent c0d12900
...@@ -119,7 +119,7 @@ func (p *proxy) SetAPIServerPort(ctx context.Context, port int) error { ...@@ -119,7 +119,7 @@ func (p *proxy) SetAPIServerPort(ctx context.Context, port int) error {
p.apiServerURL = u.String() p.apiServerURL = u.String()
p.apiServerEnabled = true p.apiServerEnabled = true
if p.lbEnabled { if p.lbEnabled && p.apiServerLB == nil {
lbServerPort := p.lbServerPort lbServerPort := p.lbServerPort
if lbServerPort != 0 { if lbServerPort != 0 {
lbServerPort = lbServerPort - 1 lbServerPort = lbServerPort - 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment