Revert "Implement notifies for transfer plugin (#3972)" (#3995)

This reverts commit 68f1dd5ddf.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2020-07-08 09:00:26 -07:00
committed by GitHub
parent 68f1dd5ddf
commit 614d08cba2
42 changed files with 988 additions and 707 deletions

View File

@@ -10,8 +10,8 @@ import (
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/metrics"
clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/coredns/coredns/plugin/pkg/parse"
"github.com/coredns/coredns/plugin/pkg/upstream"
"github.com/coredns/coredns/plugin/transfer"
"github.com/caddyserver/caddy"
)
@@ -28,13 +28,10 @@ func setup(c *caddy.Controller) error {
c.OnStartup(func() error {
m := dnsserver.GetConfig(c).Handler("prometheus")
if m != nil {
(&a).metrics = m.(*metrics.Metrics)
}
t := dnsserver.GetConfig(c).Handler("transfer")
if t != nil {
(&a).transfer = t.(*transfer.Transfer)
if m == nil {
return nil
}
(&a).metrics = m.(*metrics.Metrics)
return nil
})
@@ -150,6 +147,15 @@ func autoParse(c *caddy.Controller) (Auto, error) {
// remove soon
c.RemainingArgs() // eat remaining args
case "transfer":
t, _, e := parse.Transfer(c, false)
if e != nil {
return a, e
}
if t != nil {
a.loader.transferTo = append(a.loader.transferTo, t...)
}
default:
return Auto{}, c.Errf("unknown property '%s'", c.Val())
}