zones: Machine.SetGateway()

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-26 18:32:44 +00:00
parent b4f1d2e4d9
commit af90825f13
2 changed files with 38 additions and 0 deletions
+20
View File
@@ -228,3 +228,23 @@ func (m *Machine) RemoveWireguardConfig(ring int) error {
return err
}
func (m *Machine) createRingInfo(ring int, enabled bool) (*RingInfo, error) {
keys, err := wireguard.NewKeyPair()
if err != nil {
return nil, err
}
ri := &RingInfo{
Ring: ring,
Enabled: enabled,
Keys: keys,
}
err = m.applyRingInfo(ring, ri)
if err != nil {
return nil, err
}
return ri, nil
}