mw/kubernetes: add reverse_test.go (#922)

This PR adds a reverse tests that copies some of it from the main
integration test. This aids in local testing because you don't need
a full k8s setup running.

It does the most minimal testing, a successful return and a nodata
response that includes the SOA for in-addr.arpa.
This commit is contained in:
Miek Gieben 2017-08-16 07:33:35 +01:00 committed by GitHub
parent 479c8bbaa9
commit 06644c2855
4 changed files with 150 additions and 19 deletions

View file

@ -21,8 +21,7 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
m := new(dns.Msg)
m.SetReply(r)
m.Authoritative, m.RecursionAvailable, m.Compress = true, true, true
// Check that query matches one of the zones served by this middleware,
// otherwise delegate to the next in the pipeline.
zone := middleware.Zones(k.Zones).Matches(state.Name())
if zone == "" {
if k.Fallthrough {