zones: Zones.PruneWireguardConfig()

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-25 20:20:59 +00:00
parent 4ca77b0ac0
commit 311ae572da
+13
View File
@@ -15,3 +15,16 @@ func (z *Zone) PruneWireguardConfig(ring int) error {
return err
}
// PruneWireguardConfig removes wgN.conf files of machines with
// the corresponding ring disabled on all zones
func (m *Zones) PruneWireguardConfig(ring int) error {
var err error
m.ForEachZone(func(z *Zone) bool {
err = z.PruneWireguardConfig(ring)
return err != nil
})
return err
}