Commit caf2553d authored by Chris O'Haver's avatar Chris O'Haver Committed by John Belamaric

fix ptr nxdomain response and test (#1524)

parent ca5097ca
...@@ -18,6 +18,9 @@ func (k *Kubernetes) Reverse(state request.Request, exact bool, opt plugin.Optio ...@@ -18,6 +18,9 @@ func (k *Kubernetes) Reverse(state request.Request, exact bool, opt plugin.Optio
} }
records := k.serviceRecordForIP(ip, state.Name()) records := k.serviceRecordForIP(ip, state.Name())
if len(records) == 0 {
return records, errNoItems
}
return records, nil return records, nil
} }
......
...@@ -155,7 +155,7 @@ func TestReverse(t *testing.T) { ...@@ -155,7 +155,7 @@ func TestReverse(t *testing.T) {
}, },
{ {
Qname: "101.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR, Qname: "101.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
Rcode: dns.RcodeSuccess, Rcode: dns.RcodeNameError,
Ns: []dns.RR{ Ns: []dns.RR{
test.SOA("0.10.in-addr.arpa. 300 IN SOA ns.dns.0.10.in-addr.arpa. hostmaster.0.10.in-addr.arpa. 1502782828 7200 1800 86400 60"), test.SOA("0.10.in-addr.arpa. 300 IN SOA ns.dns.0.10.in-addr.arpa. hostmaster.0.10.in-addr.arpa. 1502782828 7200 1800 86400 60"),
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment