From 8948b6702a39a72012d723be0b5aa9a128ee2116 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Mon, 29 Jul 2024 16:46:43 +0000 Subject: [PATCH] Revert "cluster: fix wg1 generation (AllowedIPs)" This reverts commit f0c09c2176337964b874efcb17d9d419794ca967. --- pkg/cluster/wireguard.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/wireguard.go b/pkg/cluster/wireguard.go index 932fe32..ce71b88 100644 --- a/pkg/cluster/wireguard.go +++ b/pkg/cluster/wireguard.go @@ -97,10 +97,14 @@ func (m *Cluster) WriteWireguardConfig(ring rings.RingID) error { // WriteWireguardConfig rewrites all wgN.conf on all machines // on the Zone attached to that ring func (z *Zone) WriteWireguardConfig(ring rings.RingID) error { - if ring == rings.RingZeroID || ring == rings.RingOneID { + switch ring { + case rings.RingZeroID: return writeWireguardConfig(z.zones, z.zones, ring) + case rings.RingOneID: + return writeWireguardConfig(z.zones, z, ring) + default: + return ErrInvalidRing(ring) } - return ErrInvalidRing(ring) } func writeWireguardConfig(z ZoneIterator, m MachineIterator, ring rings.RingID) error {