Skip to content

Commit

Permalink
cmd/microcloudd: Remove secret and mDNS from daemon
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Pelizäus <[email protected]>
  • Loading branch information
roosterfish committed Sep 4, 2024
1 parent c97a613 commit 61ed5e4
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions cmd/microcloudd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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})
}
}

Expand All @@ -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),
Expand Down

0 comments on commit 61ed5e4

Please sign in to comment.