diff options
author | 2018-01-07 16:32:59 +0000 | |
---|---|---|
committer | 2018-01-07 16:32:59 +0000 | |
commit | c6febe6250361eee580dbb8a601a444f23ed7ac2 (patch) | |
tree | ee81ab66cfa382d66bc085d31804efb8c1059af2 /plugin/hosts/setup.go | |
parent | 84ebbbc7225a8d7eb5e00c0c525f7e12932a9fe4 (diff) | |
download | coredns-c6febe6250361eee580dbb8a601a444f23ed7ac2.tar.gz coredns-c6febe6250361eee580dbb8a601a444f23ed7ac2.tar.zst coredns-c6febe6250361eee580dbb8a601a444f23ed7ac2.zip |
Add pkg/fall for Fallthrough (#1355)
* Add pkg/fall for Fallthrough
Move this into it's own package to facilitate tests. Important bug
was fixed: make the names fully qualified.
Add fall package to hosts, reverse, etcd, and fix kubernetes and any
tests. The k8s tests are still as-is, might need a future cleanup.
Diffstat (limited to 'plugin/hosts/setup.go')
-rw-r--r-- | plugin/hosts/setup.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/plugin/hosts/setup.go b/plugin/hosts/setup.go index 1b281b9a3..35b0c5483 100644 --- a/plugin/hosts/setup.go +++ b/plugin/hosts/setup.go @@ -9,6 +9,7 @@ import ( "github.com/coredns/coredns/core/dnsserver" "github.com/coredns/coredns/plugin" + "github.com/coredns/coredns/plugin/pkg/fall" "github.com/mholt/caddy" ) @@ -105,14 +106,10 @@ func hostsParse(c *caddy.Controller) (Hosts, error) { for c.NextBlock() { switch c.Val() { case "fallthrough": - args := c.RemainingArgs() - if len(args) == 0 { - h.Fallthrough = true - continue - } - return h, c.ArgErr() + h.Fall = fall.New() + h.Fall.SetZones(c.RemainingArgs()) default: - if !h.Fallthrough { + if h.Fall.IsNil() { line := strings.Join(append([]string{c.Val()}, c.RemainingArgs()...), " ") inline = append(inline, line) continue |