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

@@ -10,6 +10,7 @@ import (
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/file"
"github.com/coredns/coredns/plugin/pkg/fall"
"github.com/coredns/coredns/plugin/pkg/upstream"
"github.com/coredns/coredns/request"
@@ -22,6 +23,7 @@ import (
// Route53 is a plugin that returns RR from AWS route53.
type Route53 struct {
Next plugin.Handler
Fall fall.F
zoneNames []string
client route53iface.Route53API
@@ -103,6 +105,10 @@ func (h *Route53) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
m.Answer, m.Ns, m.Extra, result = z.z.Lookup(state, qname)
h.zMu.RUnlock()
if len(m.Answer) == 0 && h.Fall.Through(qname) {
return plugin.NextOrFailure(h.Name(), h.Next, ctx, w, r)
}
switch result {
case file.Success:
case file.NoData: