update ListMachines to include machine state from Corrosion membership

This commit is contained in:
Pavel Sviderski
2024-11-13 16:48:55 +10:00
parent bd0e7f44b2
commit 913fb2da0c
6 changed files with 308 additions and 71 deletions
+4 -1
View File
@@ -256,7 +256,7 @@ func (m *Machine) Run(ctx context.Context) error {
// Signal that the machine is ready.
close(m.started)
// Control loop for managing the network controller.
// Control loop for managing components that depend on the machine being initialised as a cluster member.
errGroup.Go(
func() error {
if !m.Initialised() {
@@ -276,6 +276,9 @@ func (m *Machine) Run(ctx context.Context) error {
// It can be reset when leaving the cluster and then re-initialised again with a new configuration.
case <-m.initialised:
var err error
m.cluster.UpdateMachineID(m.state.ID)
// Ensure the corrosion config is up to date, including a new gossip address if the machine
// has just joined a cluster.
if err = m.configureCorrosion(); err != nil {