mirror of
https://github.com/coredns/coredns.git
synced 2026-07-18 21:50:11 -04:00
plugin/transfer: collect all notify errors instead of shadowing (#8283)
* plugin/transfer: collect all notify errors instead of shadowing Signed-off-by: ncesam <rybushkin09@bk.ru> * plugin/transfer: add regression test for notify multiple failures Signed-off-by: ncesam <rybushkin09@bk.ru> --------- Signed-off-by: ncesam <rybushkin09@bk.ru>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package transfer
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
@@ -25,17 +26,17 @@ func (t *Transfer) Notify(zone string) error {
|
||||
}
|
||||
c := notifyClient(x)
|
||||
|
||||
var err1 error
|
||||
var errs error
|
||||
for _, t := range x.to {
|
||||
if t == "*" {
|
||||
continue
|
||||
}
|
||||
if err := sendNotify(c, m, t); err != nil {
|
||||
err1 = err
|
||||
errs = errors.Join(errs, err)
|
||||
}
|
||||
}
|
||||
log.Debugf("Sent notifies for zone %q to %v", zone, x.to)
|
||||
return err1 // this only captures the last error
|
||||
return errs
|
||||
}
|
||||
|
||||
func notifyClient(x *xfr) *dns.Client {
|
||||
|
||||
Reference in New Issue
Block a user