mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 14:14:52 +00:00
fix: reconfigure WireGuard peers when listed >=1 machines in cluster store (fixes #155)
This commit is contained in:
1 parent
48d2239f5d
commit
b6dfc2175f
4 files changed
+18
-3
No files matched your search
@@ -358,6 +358,14 @@ func (cc *clusterController) handleMachineChanges(ctx context.Context) error {
|
||||
slog.Error("Failed to list machines.", "err", err)
|
||||
continue
|
||||
}
|
||||
// Skip reconfiguration if the machines list is empty. This can happen when joining the cluster.
|
||||
// Corrosion can notifies about table changes before the data is fully replicated.
|
||||
// Reconfiguring with an empty list would remove all peers and lock this machine out of the cluster.
|
||||
// See https://github.com/psviderski/uncloud/issues/155.
|
||||
if len(machines) == 0 {
|
||||
slog.Debug("Skipping peer reconfiguration: machines list in store is empty.")
|
||||
continue
|
||||
}
|
||||
if err = cc.configurePeers(machines); err != nil {
|
||||
slog.Error("Failed to configure peers.", "err", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user