k3s/pkg/daemons/control
Brad Davidson 0218426cfd Fix race condition in tunnel server startup
Several places in the code used a 5-second retry loop to wait on
Runtime.Core to be set. This caused a race condition where OnChange
handlers could be added after the Wrangler shared informers were already
started. When this happened, the handlers were never called because the
shared informers they relied upon were not started.

Fix that by requiring anything that waits on Runtime.Core to run from a
cluster controller startup hook that is guaranteed to be called before
the shared informers are started, instead of just firing it off in a
goroutine that retries until it is set.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit c44d33d29b)
2023-05-10 15:02:29 -07:00
..
deps [Release-1.24] CLI + Config Enhancement (#7407) 2023-05-02 15:09:08 -07:00
proxy Fix occasional "TLS handshake error" in apiserver network proxy. 2022-10-07 16:57:30 -07:00
server.go Add support for `k3s token` command 2023-02-10 09:34:10 -08:00
tunnel.go Fix race condition in tunnel server startup 2023-05-10 15:02:29 -07:00