Commit a8b9e7ef authored by Brad Davidson's avatar Brad Davidson Committed by Brad Davidson

Fix initial start of etcd only nodes (#3748)

Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com> Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> (cherry picked from commit 2069cdf4)
parent 06fad1b0
......@@ -418,6 +418,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
logrus.Info("Starting " + version.Program + " " + app.App.Version)
notifySocket := os.Getenv("NOTIFY_SOCKET")
ctx := signals.SetupSignalHandler(context.Background())
if err := server.StartServer(ctx, &serverConfig, cfg); err != nil {
......@@ -434,7 +436,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
}
logrus.Info(version.Program + " is up and running")
if (cfg.DisableAgent || cfg.DisableAPIServer) && os.Getenv("NOTIFY_SOCKET") != "" {
if (cfg.DisableAgent || cfg.DisableAPIServer) && notifySocket != "" {
os.Setenv("NOTIFY_SOCKET", notifySocket)
systemd.SdNotify(true, "READY=1\n")
}
}()
......
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