middleware/etcd: Return json parsing errors (#158)

When coredns unmarshals a json value and it fails it will put the error
in the returned message iff the query was a debug query
(o-o.debug.<REST>).
This commit is contained in:
Miek Gieben
2016-06-07 20:57:45 +01:00
parent d04abdf422
commit 3110306296
4 changed files with 41 additions and 8 deletions

View File

@@ -39,7 +39,7 @@ etcd [zones...] {
pointing to external names. If you want CoreDNS to act as a proxy for clients you'll need to add
the proxy middleware.
* `tls` followed the cert, key and the CA's cert filenames.
* `debug` allow debug queries. Prefix the name with `o-o.debug.` to reveive extra information in the
* `debug` allow debug queries. Prefix the name with `o-o.debug.` to retrieve extra information in the
additional section of the reply in the form of text records:
skydns.test.skydns.dom.a. 300 CH TXT "127.0.0.1:0(10,0,,false)[0,]"
@@ -47,6 +47,13 @@ etcd [zones...] {
This shows the complete key as the owername, the rdata of the TXT record has:
`host:port(priority,weight,txt content,mail)[targetstrip,group]`.
Any errors seen doing parsing will show up like this:
. 0 CH TXT "/skydns/local/skydns/r/a: invalid character '.' after object key:value pair"
which shows `a.r.skydns.local.` has a json encoding problem.
## Examples
This is the default SkyDNS setup, with everying specified in full: