plugin/route53: add fallthrough (#2132)

Automatically submitted.
This commit is contained in:
Can Yucel
2018-09-25 11:41:05 -07:00
committed by corbot[bot]
parent b89006dda1
commit 8d4378d712
5 changed files with 65 additions and 2 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/fall"
clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/coredns/coredns/plugin/pkg/upstream"
@@ -36,6 +37,8 @@ func init() {
func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Route53API) error {
keys := map[string]string{}
credential := credentials.NewEnvCredentials()
var fall fall.F
up, _ := upstream.New(nil)
for c.Next() {
args := c.RemainingArgs()
@@ -75,6 +78,8 @@ func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Ro
if err != nil {
return c.Errf("invalid upstream: %v", err)
}
case "fallthrough":
fall.SetZonesFromArgs(c.RemainingArgs())
default:
return c.Errf("unknown property '%s'", c.Val())
}
@@ -86,6 +91,7 @@ func setup(c *caddy.Controller, f func(*credentials.Credentials) route53iface.Ro
if err != nil {
return c.Errf("failed to create Route53 plugin: %v", err)
}
h.Fall = fall
if err := h.Run(ctx); err != nil {
return c.Errf("failed to initialize Route53 plugin: %v", err)
}