zones: introduce Machine.createRingInfo()
Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
@@ -134,3 +134,18 @@ func (m *Machine) applyZoneNodeID(zoneID, nodeID int) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Machine) createRingInfo(ring int, enabled bool) error {
|
||||
keys, err := wireguard.NewKeyPair()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ri := &RingInfo{
|
||||
Ring: ring,
|
||||
Enabled: enabled,
|
||||
Keys: keys,
|
||||
}
|
||||
|
||||
return m.applyRingInfo(ring, ri)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user