From b4f1d2e4d955a80024a531e0bb22c9a263ece24f Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Sat, 26 Aug 2023 18:31:56 +0000 Subject: [PATCH] wireguard: implement Machine.SyncWireguardConfig() Signed-off-by: Alejandro Mery --- pkg/zones/wireguard.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/zones/wireguard.go b/pkg/zones/wireguard.go index 48fc419..be0f418 100644 --- a/pkg/zones/wireguard.go +++ b/pkg/zones/wireguard.go @@ -16,6 +16,7 @@ var ( _ WireguardConfigSyncer = (*Zones)(nil) _ WireguardConfigSyncer = (*Zone)(nil) + _ WireguardConfigSyncer = (*Machine)(nil) _ WireguardKeysWriter = (*Zones)(nil) _ WireguardKeysWriter = (*Zone)(nil) @@ -200,6 +201,12 @@ func syncWireguardConfig(z ZoneIterator, m MachineIterator, ring int) error { return err } +// SyncWireguardConfig updates all wgN.conf files for the specified +// ring +func (m *Machine) SyncWireguardConfig(ring int) error { + return m.zone.SyncWireguardConfig(ring) +} + // A WireguardKeysWriter writes the Wireguard Keys for all machines // under its scope for the specified ring type WireguardKeysWriter interface {