mirror of
https://github.com/coredns/coredns.git
synced 2025-10-30 09:43:17 -04:00
mw/etcd: fix 'fallthrough' (#1026)
* mw/etcd: revert 'add fallthrough' This removes 'fallthrough' for *etcd* which is not needed. This was added in00f5c7797but is totally not needed and creates backwards incompat behavior even. Thanks to @johnbelamaric for pointing this out in #925. * remove here as well * Revert "remove here as well" This reverts commit9d44397827. * Revert "mw/etcd: revert 'add fallthrough'" This reverts commit0cfe3cb1ab. * mw/{etcd,kubernetes}: use fallthrough correctly reverts of reverts, will rebase and squash later.
This commit is contained in:
committed by
John Belamaric
parent
594c6d7522
commit
bcdc99ab11
@@ -42,10 +42,7 @@ func (e *Etcd) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
|
||||
if opt.Debug != "" {
|
||||
r.Question[0].Name = opt.Debug
|
||||
}
|
||||
if e.Fallthrough {
|
||||
return middleware.NextOrFailure(e.Name(), e.Next, ctx, w, r)
|
||||
}
|
||||
return dns.RcodeServerFailure, nil
|
||||
return middleware.NextOrFailure(e.Name(), e.Next, ctx, w, r)
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -88,6 +85,9 @@ func (e *Etcd) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
|
||||
}
|
||||
|
||||
if e.IsNameError(err) {
|
||||
if e.Fallthrough {
|
||||
return middleware.NextOrFailure(e.Name(), e.Next, ctx, w, r)
|
||||
}
|
||||
// Make err nil when returning here, so we don't log spam for NXDOMAIN.
|
||||
return middleware.BackendError(e, zone, dns.RcodeNameError, state, debug, nil /* err */, opt)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user