Skip to content

Commit

Permalink
Fix agent tunnel address on rke2
Browse files Browse the repository at this point in the history
Fix issue where rke2 tunnel was trying to connect to apiserver port instead of supervisor

Signed-off-by: Brad Davidson <[email protected]>
(cherry picked from commit 5a5b136)
Signed-off-by: Brad Davidson <[email protected]>
  • Loading branch information
brandond committed Dec 10, 2024
1 parent 42b4da8 commit ad873ec
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/agent/tunnel/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,14 @@ func (a *agentTunnel) getProxySyncer(ctx context.Context, wg *sync.WaitGroup, tl
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()...)
if newAddresses.Equal(curAddresses) {
return
}

proxy.Update(addresses)
newAddresses := sets.New(proxy.SupervisorAddresses()...)

// add new servers
for address := range newAddresses.Difference(curAddresses) {
Expand Down

0 comments on commit ad873ec

Please sign in to comment.