plugin/federation: Add upstream option to federation (#2177)

* add upstream

* add upstream

* debug ci

* debug ci

* set context

* update readme

* update readme

* remove empty if
This commit is contained in:
Chris O'Haver
2018-10-15 12:43:03 -04:00
committed by Francois Tur
parent 1847ef6bd3
commit 6beeabc47c
3 changed files with 28 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/kubernetes"
"github.com/coredns/coredns/plugin/pkg/upstream"
"github.com/miekg/dns"
"github.com/mholt/caddy"
@@ -62,6 +63,13 @@ func federationParse(c *caddy.Controller) (*Federation, error) {
for c.NextBlock() {
x := c.Val()
switch x {
case "upstream":
args := c.RemainingArgs()
u, err := upstream.New(args)
if err != nil {
return nil, err
}
fed.Upstream = &u
default:
args := c.RemainingArgs()
if x := len(args); x != 1 {