plugin/auto/file/secondary: Use new upstream resolver (#1534)

* move file, auto, secondary to new upstream

* include context in request
This commit is contained in:
Chris O'Haver
2018-02-16 03:44:50 -05:00
committed by Miek Gieben
parent fc1d73ffa9
commit ba573c0f40
12 changed files with 30 additions and 36 deletions

View File

@@ -11,9 +11,8 @@ import (
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/metrics"
"github.com/coredns/coredns/plugin/pkg/dnsutil"
"github.com/coredns/coredns/plugin/pkg/parse"
"github.com/coredns/coredns/plugin/proxy"
"github.com/coredns/coredns/plugin/pkg/upstream"
"github.com/mholt/caddy"
)
@@ -151,11 +150,11 @@ func autoParse(c *caddy.Controller) (Auto, error) {
if len(args) == 0 {
return a, c.ArgErr()
}
ups, err := dnsutil.ParseHostPortOrFile(args...)
var err error
a.loader.upstream, err = upstream.NewUpstream(args)
if err != nil {
return a, err
}
a.loader.proxy = proxy.NewLookup(ups)
default:
t, _, e := parse.Transfer(c, false)