mw/k8s: remove k.defaultNsMsg() (#892)

Remove k.defaultNSMsg() it is just one line of getting the service and
it is another method that needlessly uses recordRequest.
This commit is contained in:
Miek Gieben 2017-08-11 08:34:35 +01:00 committed by GitHub
parent c0f62e3f65
commit b5d2a82ed7
2 changed files with 3 additions and 16 deletions

View file

@ -130,8 +130,9 @@ func (k *Kubernetes) Services(state request.Request, exact bool, opt middleware.
if state.Type() == "A" && isDefaultNS(state.Name(), r) {
// If this is an A request for "ns.dns", respond with a "fake" record for coredns.
// SOA records always use this hardcoded name
svcs = append(svcs, k.defaultNSMsg(r))
return svcs, nil, nil
ns := k.nsAddr()
svc := msg.Service{Host: ns.A.String(), Key: msg.Path(state.QName(), "coredns")}
return []msg.Service{svc}, nil, nil
}
s, e := k.Entries(r)
if state.QType() == dns.TypeAAAA {