cluster: migrate to using pkg/rings for Addresses [WIP]
Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
@@ -38,8 +38,8 @@ func (m *Machine) init() error {
|
||||
return core.Wrap(err, m.Name)
|
||||
}
|
||||
|
||||
for i := 0; i < RingsCount; i++ {
|
||||
if err := m.tryReadWireguardKeys(i); err != nil {
|
||||
for _, r := range Rings {
|
||||
if err := m.tryReadWireguardKeys(r.ID); err != nil {
|
||||
return core.Wrap(err, m.Name)
|
||||
}
|
||||
}
|
||||
@@ -72,12 +72,12 @@ func (m *Machine) setID() error {
|
||||
|
||||
// scan is called once we know about all zones and machine names
|
||||
func (m *Machine) scan(_ *ScanOptions) error {
|
||||
for i := 0; i < RingsCount; i++ {
|
||||
if err := m.tryApplyWireguardConfig(i); err != nil {
|
||||
for _, ring := range Rings {
|
||||
if err := m.tryApplyWireguardConfig(ring.ID); err != nil {
|
||||
m.error(err).
|
||||
WithField("subsystem", "wireguard").
|
||||
WithField("node", m.Name).
|
||||
WithField("ring", i).
|
||||
WithField("ring", ring.ID).
|
||||
Print()
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user