Commit 96a2a74e authored by Erik Wilson's avatar Erik Wilson Committed by Darren Shepherd

Make systemd notify optional in generic api server

To properly notify systemd that the k3s server is ready we need to prevent the current k8s notification and add one to the k3s cli.
parent e6179612
...@@ -44,6 +44,10 @@ import ( ...@@ -44,6 +44,10 @@ import (
restclient "k8s.io/client-go/rest" restclient "k8s.io/client-go/rest"
) )
var (
NotifySystemD = true
)
// Info about an API group. // Info about an API group.
type APIGroupInfo struct { type APIGroupInfo struct {
PrioritizedVersions []schema.GroupVersion PrioritizedVersions []schema.GroupVersion
...@@ -292,9 +296,11 @@ func (s preparedGenericAPIServer) NonBlockingRun(stopCh <-chan struct{}) error { ...@@ -292,9 +296,11 @@ func (s preparedGenericAPIServer) NonBlockingRun(stopCh <-chan struct{}) error {
s.RunPostStartHooks(stopCh) s.RunPostStartHooks(stopCh)
if NotifySystemD {
if _, err := systemd.SdNotify(true, "READY=1\n"); err != nil { if _, err := systemd.SdNotify(true, "READY=1\n"); err != nil {
klog.Errorf("Unable to send systemd daemon successful start message: %v\n", err) klog.Errorf("Unable to send systemd daemon successful start message: %v\n", err)
} }
}
return nil return nil
} }
......
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