Skip to content

Commit

Permalink
Fix initial start of etcd only nodes (k3s-io#3748)
Browse files Browse the repository at this point in the history
* Fix initial start of etcd only nodes

Signed-off-by: galal-hussein <[email protected]>

* more fixes

Signed-off-by: galal-hussein <[email protected]>

* more fixes

Signed-off-by: galal-hussein <[email protected]>
(cherry picked from commit 2069cdf)
Signed-off-by: Brad Davidson <[email protected]>
  • Loading branch information
galal-hussein authored and brandond committed Aug 25, 2021
1 parent 87a9634 commit 0b8b73c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cli/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,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); err != nil {
Expand All @@ -387,7 +389,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")
}
}()
Expand Down

0 comments on commit 0b8b73c

Please sign in to comment.