diff options
author | 2018-02-16 03:44:50 -0500 | |
---|---|---|
committer | 2018-02-16 09:44:50 +0100 | |
commit | ba573c0f407732527209b717866637e4b3093804 (patch) | |
tree | 5b5ab41891017b20e9db30a6b7957b1358f74588 /plugin/file/setup.go | |
parent | fc1d73ffa9ae193c4cfca4adc194ae43f9360dbb (diff) | |
download | coredns-ba573c0f407732527209b717866637e4b3093804.tar.gz coredns-ba573c0f407732527209b717866637e4b3093804.tar.zst coredns-ba573c0f407732527209b717866637e4b3093804.zip |
plugin/auto/file/secondary: Use new upstream resolver (#1534)
* move file, auto, secondary to new upstream
* include context in request
Diffstat (limited to 'plugin/file/setup.go')
-rw-r--r-- | plugin/file/setup.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/plugin/file/setup.go b/plugin/file/setup.go index 3c25b4f7d..5f55eebe3 100644 --- a/plugin/file/setup.go +++ b/plugin/file/setup.go @@ -6,9 +6,8 @@ import ( "github.com/coredns/coredns/core/dnsserver" "github.com/coredns/coredns/plugin" - "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" ) @@ -90,7 +89,7 @@ func fileParse(c *caddy.Controller) (Zones, error) { } noReload := false - prxy := proxy.Proxy{} + upstr := upstream.Upstream{} t := []string{} var e error @@ -107,14 +106,11 @@ func fileParse(c *caddy.Controller) (Zones, error) { case "upstream": args := c.RemainingArgs() - if len(args) == 0 { - return Zones{}, c.ArgErr() - } - ups, err := dnsutil.ParseHostPortOrFile(args...) + upstr, err = upstream.NewUpstream(args) if err != nil { return Zones{}, err } - prxy = proxy.NewLookup(ups) + default: return Zones{}, c.Errf("unknown property '%s'", c.Val()) } @@ -124,7 +120,7 @@ func fileParse(c *caddy.Controller) (Zones, error) { z[origin].TransferTo = append(z[origin].TransferTo, t...) } z[origin].NoReload = noReload - z[origin].Proxy = prxy + z[origin].Upstream = upstr } } } |