Unverified Commit 2069cdf4 authored by Hussein Galal's avatar Hussein Galal Committed by GitHub

Fix initial start of etcd only nodes (#3748)

* Fix initial start of etcd only nodes Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * more fixes Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * more fixes Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com>
parent 429af17e
...@@ -366,6 +366,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont ...@@ -366,6 +366,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
logrus.Info("Starting " + version.Program + " " + app.App.Version) logrus.Info("Starting " + version.Program + " " + app.App.Version)
notifySocket := os.Getenv("NOTIFY_SOCKET")
ctx := signals.SetupSignalHandler(context.Background()) ctx := signals.SetupSignalHandler(context.Background())
if err := server.StartServer(ctx, &serverConfig, cfg); err != nil { if err := server.StartServer(ctx, &serverConfig, cfg); err != nil {
...@@ -382,7 +384,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont ...@@ -382,7 +384,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
} }
logrus.Info(version.Program + " is up and running") 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") 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