Unverified Commit 2e91913f authored by Hussein Galal's avatar Hussein Galal Committed by GitHub

Close agentReady channel only in k3s (#4792)

* Close agentReady channel only in k3s Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * codespell check Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com>
parent 8ad7d141
......@@ -174,7 +174,13 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
serverConfig.ControlConfig.DisableScheduler = true
serverConfig.ControlConfig.DisableCCM = true
close(agentReady)
// only close the agentReady channel in case of k3s restoration, because k3s does not start
// the agent until server returns successfully, unlike rke2's agent which starts in parallel
// with the server
if serverConfig.ControlConfig.SupervisorPort == serverConfig.ControlConfig.HTTPSPort {
close(agentReady)
}
dataDir, err := datadir.LocalHome(cfg.DataDir, false)
if err != nil {
return err
......
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