From 61ed5e42c64ff68967909dc1fd1874f0401b8f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Peliz=C3=A4us?= Date: Mon, 26 Aug 2024 14:44:50 +0200 Subject: [PATCH] cmd/microcloudd: Remove secret and mDNS from daemon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julian Pelizäus --- cmd/microcloudd/main.go | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/cmd/microcloudd/main.go b/cmd/microcloudd/main.go index fad6c349..f49eea8c 100644 --- a/cmd/microcloudd/main.go +++ b/cmd/microcloudd/main.go @@ -85,14 +85,6 @@ func (c *cmdDaemon) Run(cmd *cobra.Command, args []string) error { // Periodically check if new services have been installed. go func() { for { - if s.AuthSecret == "" { - logger.Debug("Waiting for initial setup before checking for optional services") - time.Sleep(1 * time.Second) - - continue - } - - updated := false for serviceName, stateDir := range optionalServices { if service.Exists(serviceName, stateDir) { if s.Services[serviceName] != nil { @@ -105,24 +97,9 @@ func (c *cmdDaemon) Run(cmd *cobra.Command, args []string) error { break } - updated = true s.Services[serviceName] = newService.Services[serviceName] } else if s.Services[serviceName] != nil { delete(s.Services, serviceName) - updated = true - } - } - - if updated { - err = s.StopBroadcast() - if err != nil { - logger.Error("Failed to shutdown broadcast after detecting new services", logger.Ctx{"error": err}) - continue - } - - err = s.Broadcast() - if err != nil { - logger.Error("Failed to restart broadcast after detecting new services", logger.Ctx{"error": err}) } } @@ -134,6 +111,8 @@ func (c *cmdDaemon) Run(cmd *cobra.Command, args []string) error { api.ServicesCmd(s), api.ServiceTokensCmd(s), api.ServicesClusterCmd(s), + api.SessionJoinCmd(s), + api.SessionCmd(s), api.LXDProxy(s), api.CephProxy(s), api.OVNProxy(s),