zones: add ResolvePublicAddresses() ScanOption to prevent early LookupIP calls

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-28 15:42:48 +00:00
parent 216bf5aa29
commit 0989dec5e8
3 changed files with 24 additions and 5 deletions
+6 -2
View File
@@ -52,12 +52,16 @@ func (m *Machine) setID() error {
return nil
}
func (m *Machine) scan() error {
func (m *Machine) scan(opts *ScanOptions) error {
for i := 0; i < RingsCount; i++ {
if err := m.tryApplyWireguardConfig(i); err != nil {
return err
}
}
return m.updatePublicAddresses()
if !opts.DontResolvePublicAddresses {
return m.updatePublicAddresses()
}
return nil
}