cluster: decouple RingID from WireguardInterfaceID
Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
@@ -53,13 +53,13 @@ func (m *Machine) IsActive() bool {
|
||||
|
||||
// IsGateway tells if the Machine is a ring0 gateway
|
||||
func (m *Machine) IsGateway() bool {
|
||||
_, ok := m.getRingInfo(0)
|
||||
_, ok := m.getRingInfo(rings.RingZeroID)
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetGateway enables/disables a Machine ring0 integration
|
||||
func (m *Machine) SetGateway(enabled bool) error {
|
||||
ri, found := m.getRingInfo(0)
|
||||
ri, found := m.getRingInfo(rings.RingZeroID)
|
||||
switch {
|
||||
case !found && !enabled:
|
||||
return nil
|
||||
@@ -72,7 +72,7 @@ func (m *Machine) SetGateway(enabled bool) error {
|
||||
}
|
||||
|
||||
ri.Enabled = enabled
|
||||
return m.SyncWireguardConfig(0)
|
||||
return m.SyncWireguardConfig(rings.RingZeroID)
|
||||
}
|
||||
|
||||
// Zone indicates the [Zone] this machine belongs to
|
||||
|
||||
Reference in New Issue
Block a user