mirror of https://github.com/k3s-io/k3s
Fix agent tunnel address on rke2
Fix issue where rke2 tunnel was trying to connect to apiserver port instead of supervisor
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 5a5b136151
)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
pull/11460/head
parent
7bc029942c
commit
897193a067
|
@ -505,13 +505,14 @@ func (a *agentTunnel) getProxySyncer(ctx context.Context, wg *sync.WaitGroup, tl
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
newAddresses := sets.New(addresses...)
|
// Compare list of supervisor addresses before and after syncing apiserver
|
||||||
|
// endpoints into the proxy to figure out which supervisors we need to connect to
|
||||||
|
// or disconnect from. Note that the addresses we were passed will not match
|
||||||
|
// the supervisor addresses if the supervisor and apiserver are on different ports -
|
||||||
|
// they must be round-tripped through proxy.Update before comparing.
|
||||||
curAddresses := sets.New(proxy.SupervisorAddresses()...)
|
curAddresses := sets.New(proxy.SupervisorAddresses()...)
|
||||||
if newAddresses.Equal(curAddresses) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
proxy.Update(addresses)
|
proxy.Update(addresses)
|
||||||
|
newAddresses := sets.New(proxy.SupervisorAddresses()...)
|
||||||
|
|
||||||
// add new servers
|
// add new servers
|
||||||
for address := range newAddresses.Difference(curAddresses) {
|
for address := range newAddresses.Difference(curAddresses) {
|
||||||
|
|
Loading…
Reference in New Issue