mw/etcd: revert 'add fallthrough'

This removes 'fallthrough' for *etcd* which is not needed. This was
added in 00f5c7797 but is totally not needed and creates backwards
incompat behavior even.

Thanks to @johnbelamaric for pointing this out in #925.
This commit is contained in:
Miek Gieben 2017-09-06 21:07:11 +01:00
parent 9452a0a3bc
commit 0cfe3cb1ab
5 changed files with 10 additions and 19 deletions

View file

@ -23,7 +23,6 @@ If you want to `round robin` A and AAAA responses look at the `loadbalance` midd
~~~ ~~~
etcd [ZONES...] { etcd [ZONES...] {
stubzones stubzones
fallthrough
path PATH path PATH
endpoint ENDPOINT... endpoint ENDPOINT...
upstream ADDRESS... upstream ADDRESS...
@ -34,7 +33,6 @@ etcd [ZONES...] {
* `stubzones` enables the stub zones feature. The stubzone is *only* done in the etcd tree located * `stubzones` enables the stub zones feature. The stubzone is *only* done in the etcd tree located
under the *first* zone specified. under the *first* zone specified.
* `fallthrough` If zone matches but no record can be generated, pass request to the next middleware.
* **PATH** the path inside etcd. Defaults to "/skydns". * **PATH** the path inside etcd. Defaults to "/skydns".
* **ENDPOINT** the etcd endpoints. Defaults to "http://localhost:2397". * **ENDPOINT** the etcd endpoints. Defaults to "http://localhost:2397".
* `upstream` upstream resolvers to be used resolve external names found in etcd (think CNAMEs) * `upstream` upstream resolvers to be used resolve external names found in etcd (think CNAMEs)

View file

@ -21,16 +21,15 @@ import (
// Etcd is a middleware talks to an etcd cluster. // Etcd is a middleware talks to an etcd cluster.
type Etcd struct { type Etcd struct {
Next middleware.Handler Next middleware.Handler
Fallthrough bool Zones []string
Zones []string PathPrefix string
PathPrefix string Proxy proxy.Proxy // Proxy for looking up names during the resolution process
Proxy proxy.Proxy // Proxy for looking up names during the resolution process Client etcdc.KeysAPI
Client etcdc.KeysAPI Ctx context.Context
Ctx context.Context Inflight *singleflight.Group
Inflight *singleflight.Group Stubmap *map[string]proxy.Proxy // list of proxies for stub resolving.
Stubmap *map[string]proxy.Proxy // list of proxies for stub resolving. Debugging bool // Do we allow debug queries.
Debugging bool // Do we allow debug queries.
endpoints []string // Stored here as well, to aid in testing. endpoints []string // Stored here as well, to aid in testing.
} }

View file

@ -42,10 +42,7 @@ func (e *Etcd) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
if opt.Debug != "" { if opt.Debug != "" {
r.Question[0].Name = opt.Debug r.Question[0].Name = opt.Debug
} }
if e.Fallthrough { return middleware.NextOrFailure(e.Name(), e.Next, ctx, w, r)
return middleware.NextOrFailure(e.Name(), e.Next, ctx, w, r)
}
return dns.RcodeServerFailure, nil
} }
var ( var (

View file

@ -15,7 +15,6 @@ import (
func TestMultiLookup(t *testing.T) { func TestMultiLookup(t *testing.T) {
etc := newEtcdMiddleware() etc := newEtcdMiddleware()
etc.Zones = []string{"skydns.test.", "miek.nl."} etc.Zones = []string{"skydns.test.", "miek.nl."}
etc.Fallthrough = true
etc.Next = test.ErrorHandler() etc.Next = test.ErrorHandler()
for _, serv := range servicesMulti { for _, serv := range servicesMulti {

View file

@ -74,8 +74,6 @@ func etcdParse(c *caddy.Controller) (*Etcd, bool, error) {
switch c.Val() { switch c.Val() {
case "stubzones": case "stubzones":
stubzones = true stubzones = true
case "fallthrough":
etc.Fallthrough = true
case "debug": case "debug":
etc.Debugging = true etc.Debugging = true
case "path": case "path":