• Brad Davidson's avatar
    Fix race condition in tunnel server startup · 0218426c
    Brad Davidson authored
    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: 's avatarBrad Davidson <brad.davidson@rancher.com>
    (cherry picked from commit c44d33d2)
    0218426c