diff options
author | 2016-08-08 19:18:55 -0700 | |
---|---|---|
committer | 2016-08-08 19:18:55 -0700 | |
commit | ad76aef5fcf46dcdb50d8529bbf085a1578d3bda (patch) | |
tree | c662253762ad5f7ad1c4223023b2b1f1bba6b732 /server | |
parent | c079de65b520bd7690c7ac057a38b404947f3909 (diff) | |
download | coredns-ad76aef5fcf46dcdb50d8529bbf085a1578d3bda.tar.gz coredns-ad76aef5fcf46dcdb50d8529bbf085a1578d3bda.tar.zst coredns-ad76aef5fcf46dcdb50d8529bbf085a1578d3bda.zip |
Fix stubzone retention (#198)
Make the receiver a pointer so that the uptdateStubZones map update will
retain the stubzones found, unlike the current case where the update
will be applied and then promptly forgotten, because it is working on a
copy.
Add test/etcd_test.go to test a large part of the code. This didn't
catch the chaos middleware hack though. The chaos middleware zones are
now *not* automatically added. You have to take care of that by yourself
(docs updates).
When using debug queries and falling through to the next middleware in
etcd, restore the original (with o-o.debug) query before passing it on.
Diffstat (limited to 'server')
-rw-r--r-- | server/server.go | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/server/server.go b/server/server.go index ab9ce884f..0ba6f7f01 100644 --- a/server/server.go +++ b/server/server.go @@ -16,7 +16,6 @@ import ( "time" "github.com/miekg/coredns/middleware" - "github.com/miekg/coredns/middleware/chaos" "github.com/miekg/coredns/middleware/metrics" "github.com/miekg/dns" @@ -111,19 +110,6 @@ func New(addr string, configs []Config, gracefulTimeout time.Duration) (*Server, } s.zones[conf.Host] = z - - // A bit of a hack. Loop through the middlewares of this zone and check if - // they have enabled the chaos middleware. If so add the special chaos zones. - Middleware: - for _, mid := range z.config.Middleware { - fn := mid(nil) - if _, ok := fn.(chaos.Chaos); ok { - for _, ch := range []string{"authors.bind.", "version.bind.", "version.server.", "hostname.bind.", "id.server."} { - s.zones[ch] = z - } - break Middleware - } - } } return s, nil |