Skip to content

Commit

Permalink
lxd: Refresh the state on cluster put/join
Browse files Browse the repository at this point in the history
Without that, the updated global config (or server name) doesn't make it
into the state which is passed on through other functions.

Signed-off-by: Stéphane Graber <[email protected]>
(cherry picked from commit 37736893c50422050f678348fa3c5bc1f8246595)
Signed-off-by: Mark Bolton <[email protected]>
License: Apache-2.0
  • Loading branch information
stgraber authored and boltmark committed Aug 9, 2024
1 parent d02424d commit b6b7962
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lxd/api_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ func clusterPutBootstrap(d *Daemon, r *http.Request, req api.ClusterPut) respons
d.globalConfigMu.Unlock()

d.events.SetLocalLocation(d.serverName)

// Refresh the state.
s = d.State()

// Start clustering tasks
d.startClusterTasks()

Expand Down Expand Up @@ -797,6 +801,9 @@ func clusterPutJoin(d *Daemon, r *http.Request, req api.ClusterPut) response.Res
return err
}

// Refresh the state.
s = d.State()

// Start up networks so any post-join changes can be applied now that we have a Node ID.
logger.Debug("Starting networks after cluster join")
err = networkStartup(s)
Expand Down

0 comments on commit b6b7962

Please sign in to comment.