Skip to content

Commit

Permalink
lxd: Refresh the state on cluster put/join (from Incus) (#13906)
Browse files Browse the repository at this point in the history
This small PR ensures we update state upon cluster put/join.

Cherry picked from lxc/incus#366.
  • Loading branch information
tomponline authored Aug 10, 2024
2 parents 15439ec + b6b7962 commit 4a3d573
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 4a3d573

Please sign in to comment.