|
|
|
@ -183,8 +183,10 @@ func (m *Machine) applyWireguardPeerConfig(ring int, pc wireguard.PeerConfig) er
|
|
|
|
|
switch { |
|
|
|
|
case !found: |
|
|
|
|
// unknown
|
|
|
|
|
return core.Wrap(ErrUnknownNode, pc.Endpoint.Host) |
|
|
|
|
case ring == 1 && m.zone != peer.zone: |
|
|
|
|
// invalid zone
|
|
|
|
|
return core.Wrap(ErrInvalidNode, peer.Name) |
|
|
|
|
default: |
|
|
|
|
// apply RingInfo
|
|
|
|
|
ri := &RingInfo{ |
|
|
|
@ -197,8 +199,6 @@ func (m *Machine) applyWireguardPeerConfig(ring int, pc wireguard.PeerConfig) er
|
|
|
|
|
|
|
|
|
|
return peer.applyRingInfo(ring, ri) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return fmt.Errorf("%q: invalid peer endpoint", pc.Endpoint.Host) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (m *Machine) applyZoneNodeID(zoneID, nodeID int) error { |
|
|
|
|