Handle K8s middleware NS record (#662)

* commit for testing in cluster

* commit for testing in cluster

* refactor and add ns.dns record

* Release 007

* reduce heap allocations

* gofmt

* revert accidental Makefile commits

* restore prior rcode for disabled pod mode

* revert Makefile deltas

* add unit tests

* more unit tests

* make isRequestInReverseRange easier to test

* more unit tests

* addressing review feedback

* commit setup.go
This commit is contained in:
Chris O'Haver 2017-05-22 16:05:48 -04:00 committed by John Belamaric
parent 024f56682d
commit 7f950e496a
9 changed files with 537 additions and 97 deletions

View file

@ -32,7 +32,7 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
// If this is a PTR request, and the request is in a defined
// pod/service cidr range, process the request in this middleware,
// otherwise pass to next middleware.
if !k.isRequestInReverseRange(state) {
if !k.isRequestInReverseRange(state.Name()) {
return middleware.NextOrFailure(k.Name(), k.Next, ctx, w, r)
}
// Set the zone to this specific request.