aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/handler_test.go
diff options
context:
space:
mode:
authorGravatar Chris O'Haver <cohaver@infoblox.com> 2019-08-09 17:14:48 -0400
committerGravatar Miek Gieben <miek@miek.nl> 2019-08-09 21:14:48 +0000
commit3a59c833a09eafd8e67f6ac1686b30193b6220c0 (patch)
tree0a208f057ab54b41ebc5acb8e5b6fac88e384ccb /plugin/kubernetes/handler_test.go
parent6a6e9a9b33731656b51655072951649d9e716613 (diff)
downloadcoredns-3a59c833a09eafd8e67f6ac1686b30193b6220c0.tar.gz
coredns-3a59c833a09eafd8e67f6ac1686b30193b6220c0.tar.zst
coredns-3a59c833a09eafd8e67f6ac1686b30193b6220c0.zip
plugin/kubernetes: Don't do a zone transfer for NS requests (#3098)
* fix switch order * remove fallthough * add test * fix test * distingush nxdomain/nodata for at least first subdomain of zone * restore fallthough; reorder switch cases
Diffstat (limited to 'plugin/kubernetes/handler_test.go')
-rw-r--r--plugin/kubernetes/handler_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugin/kubernetes/handler_test.go b/plugin/kubernetes/handler_test.go
index 0efd03c07..a517e8b89 100644
--- a/plugin/kubernetes/handler_test.go
+++ b/plugin/kubernetes/handler_test.go
@@ -341,6 +341,14 @@ var dnsTestCases = []test.Case{
test.SOA("cluster.local. 5 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 5"),
},
},
+ // NS query for qname != zone (existing domain)
+ {
+ Qname: "svc.cluster.local.", Qtype: dns.TypeNS,
+ Rcode: dns.RcodeSuccess,
+ Ns: []dns.RR{
+ test.SOA("cluster.local. 5 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 5"),
+ },
+ },
}
func TestServeDNS(t *testing.T) {