Skip to content

Commit

Permalink
Only wait for startuphooks if apiserver is enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed Jun 13, 2022
1 parent bed2b90 commit b059965
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/agent/run.go
Expand Up @@ -116,6 +116,7 @@ func run(ctx context.Context, cfg cmds.Agent, proxy proxy.Proxy) error {
}

notifySocket := os.Getenv("NOTIFY_SOCKET")
os.Unsetenv("NOTIFY_SOCKET")

if err := setupTunnelAndRunAgent(ctx, nodeConfig, cfg, proxy); err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/server/server.go
Expand Up @@ -454,13 +454,13 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
if !serverConfig.ControlConfig.DisableAPIServer {
<-serverConfig.ControlConfig.Runtime.APIServerReady
logrus.Info("Kube API server is now running")
} else {
serverConfig.ControlConfig.Runtime.StartupHooksWg.Wait()
}
if !serverConfig.ControlConfig.DisableETCD {
<-serverConfig.ControlConfig.Runtime.ETCDReady
logrus.Info("ETCD server is now running")
}

serverConfig.ControlConfig.Runtime.StartupHooksWg.Wait()

logrus.Info(version.Program + " is up and running")
os.Setenv("NOTIFY_SOCKET", notifySocket)
systemd.SdNotify(true, "READY=1\n")
Expand Down

0 comments on commit b059965

Please sign in to comment.