mw/k8s: remove dependence on global var (#888)

* mw/k8s: remove dependence on global var

Remove the global coreDNSRecord that was used. Remove tests the
referenced that var. Cleanup the rest.

* Rename function as well

* fixes
This commit is contained in:
Miek Gieben 2017-08-10 23:13:08 +01:00 committed by GitHub
parent c65fdb5fc3
commit acfa6501e0
3 changed files with 51 additions and 92 deletions

View file

@ -112,7 +112,7 @@ func (k *Kubernetes) Services(state request.Request, exact bool, opt middleware.
return []msg.Service{svc}, nil, nil
case dns.TypeNS:
// We can only get here if the qname equal the zone, see ServeDNS in handler.go.
ns := k.coreDNSRecord()
ns := k.nsAddr()
svc := msg.Service{Host: ns.A.String(), Key: msg.Path(state.QName(), "coredns")}
return []msg.Service{svc}, nil, nil
}