Commit bfd0ed4
Paul C
v20.8.0: Stable cluster_id — WolfRouter survives renames
Introduces a stable sha256-based cluster identifier so features that
must live-match nodes against a chosen cluster (WolfRouter topology +
preflight) stop breaking when cluster_name is renamed or inconsistent
across peers. cluster_name becomes a pure display label; cluster_id
is the filter key.
Bootstrap is coordination-free: every existing node upgrading in place
hashes its current cluster_name, producing the same ID independently —
no UUID race, no leader election. First boot priority: in-memory →
/etc/wolfstack/self_cluster_id.json → adopt from any online peer with
a matching cluster_name → sha256(cluster_name) fallback.
Backward compatible both directions:
- AgentMessage.cluster_id is #[serde(default)] so old and new peers
interoperate transparently during rollout.
- Router filters accept both ?cluster_id= (preferred) and ?cluster=
(legacy); per-peer matching prefers cluster_id, falls back to
cluster_name when the peer hasn't upgraded yet.
- Existing nodes.json deserialises with cluster_id = None.
Moving a node between clusters is now a distinct first-class action:
- New POST /api/nodes/{id}/move-to-cluster writes both cluster_id and
cluster_name on a single node (unlike the rename cascade triggered
by PATCH /settings when cluster_name changes).
- Remote-target moves fan out to the target's own
/api/agent/move-self-to-cluster so the target writes its canonical
state — without this the self-gossip guard would revert the change
on the admin node's next poll.
- Node settings modal replaces freeform cluster-name input with a
display + picker ("Move to different cluster…") that lists existing
clusters by cluster_id and derives a fresh id via SubtleCrypto
SHA-256 when creating a new one, matching the backend byte-for-byte.
Other fixes wrapped in:
- Self-gossip adoption of cluster_name is now gated on cluster_id
agreement — a peer with a stale view of us can no longer revert our
state by gossiping back our old cluster_name.
- Add-server form: removed the implicit "WolfStack" default on an
empty cluster field so new nodes adopt via gossip; join-token panel
now stays visible in both WolfStack and Proxmox modes.1 parent 1450224 commit bfd0ed4
10 files changed
Lines changed: 677 additions & 90 deletions
File tree
- src
- agent
- api
- networking/router
- vms
- web
- js
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1726 | 1726 | | |
1727 | 1727 | | |
1728 | 1728 | | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
1729 | 1838 | | |
1730 | 1839 | | |
1731 | 1840 | | |
| |||
2964 | 3073 | | |
2965 | 3074 | | |
2966 | 3075 | | |
| 3076 | + | |
2967 | 3077 | | |
2968 | 3078 | | |
2969 | 3079 | | |
| |||
5084 | 5194 | | |
5085 | 5195 | | |
5086 | 5196 | | |
| 5197 | + | |
5087 | 5198 | | |
5088 | 5199 | | |
5089 | 5200 | | |
| |||
19926 | 20037 | | |
19927 | 20038 | | |
19928 | 20039 | | |
| 20040 | + | |
| 20041 | + | |
19929 | 20042 | | |
19930 | 20043 | | |
19931 | 20044 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
| 580 | + | |
580 | 581 | | |
581 | 582 | | |
582 | 583 | | |
| |||
0 commit comments