plugin/template: add upstream option (#1529)

* add upstream

* docs

* tests
This commit is contained in:
Chris O'Haver 2018-02-16 03:45:25 -05:00 committed by Miek Gieben
parent ba573c0f40
commit 2cad04ec10
4 changed files with 33 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import (
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/pkg/upstream"
"github.com/mholt/caddy"
"github.com/miekg/dns"
@ -142,6 +143,13 @@ func templateParse(c *caddy.Controller) (handler Handler, err error) {
case "fallthrough":
t.fall.SetZonesFromArgs(c.RemainingArgs())
case "upstream":
args := c.RemainingArgs()
u, err := upstream.NewUpstream(args)
if err != nil {
return handler, err
}
t.upstream = u
default:
return handler, c.ArgErr()
}