|
|
@ -97,10 +97,14 @@ func (m *Cluster) WriteWireguardConfig(ring rings.RingID) error { |
|
|
|
// WriteWireguardConfig rewrites all wgN.conf on all machines
|
|
|
|
// WriteWireguardConfig rewrites all wgN.conf on all machines
|
|
|
|
// on the Zone attached to that ring
|
|
|
|
// on the Zone attached to that ring
|
|
|
|
func (z *Zone) WriteWireguardConfig(ring rings.RingID) error { |
|
|
|
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) |
|
|
|
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 { |
|
|
|
func writeWireguardConfig(z ZoneIterator, m MachineIterator, ring rings.RingID) error { |
|
|
|