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.
This commit is contained in:
Miek Gieben
2016-08-08 19:18:55 -07:00
committed by GitHub
parent c079de65b5
commit ad76aef5fc
18 changed files with 210 additions and 104 deletions

View File

@@ -1,7 +1,7 @@
# chaos
The `chaos` middleware allows CoreDNS to response to TXT queries in CH class.
Useful for retrieving version or author information from the server.
Useful for retrieving version or author information from the server. If
## Syntax
@@ -12,9 +12,9 @@ chaos [version] [authors...]
* `version` the version to return, defaults to CoreDNS.
* `authors` what authors to return. No default.
Note this middleware can only be specified for a zone once. This is because it hijacks
the zones `version.bind`, `version.server`, `authors.bind`, `hostname.bind` and
`id.server`, which means it can only be routed to one middleware.
Note that you have to make sure that this middleware will get actual queries for the
following zones: `version.bind`, `version.server`, `authors.bind`, `hostname.bind` and
`id.server`.
## Examples