send notifies after adding zones all zones (#5774)

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
Chris O'Haver
2023-02-15 13:25:02 -05:00
committed by GitHub
parent ad623eb0d6
commit 77c7c0b4cb
4 changed files with 21 additions and 5 deletions

View File

@@ -45,6 +45,9 @@ func setup(c *caddy.Controller) error {
if err != nil {
return err
}
if err := a.Notify(); err != nil {
log.Warning(err)
}
if a.loader.ReloadInterval == 0 {
return nil
}
@@ -57,6 +60,9 @@ func setup(c *caddy.Controller) error {
return
case <-ticker.C:
a.Walk()
if err := a.Notify(); err != nil {
log.Warning(err)
}
}
}
}()

View File

@@ -59,8 +59,6 @@ func (a Auto) Walk() error {
a.metrics.AddZone(origin)
}
a.transfer.Notify(origin)
log.Infof("Inserting zone `%s' from: %s", origin, path)
toDelete[origin] = false

View File

@@ -17,3 +17,15 @@ func (a Auto) Transfer(zone string, serial uint32) (<-chan []dns.RR, error) {
}
return z.Transfer(serial)
}
// Notify sends notifies for all zones with secondaries configured with the transfer plugin
func (a Auto) Notify() error {
var err error
for _, origin := range a.Zones.Names() {
e := a.transfer.Notify(origin)
if e != nil {
err = e
}
}
return err
}