aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/handler_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/kubernetes/handler_test.go')
-rw-r--r--plugin/kubernetes/handler_test.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/plugin/kubernetes/handler_test.go b/plugin/kubernetes/handler_test.go
index 6bcb00ecd..5d74766d0 100644
--- a/plugin/kubernetes/handler_test.go
+++ b/plugin/kubernetes/handler_test.go
@@ -85,6 +85,22 @@ var dnsTestCases = []test.Case{
test.A("hdls1.testns.svc.cluster.local. 5 IN A 172.0.0.3"),
},
},
+ // A pod ip
+ {
+ Qname: "172-0-0-2.hdls1.testns.svc.cluster.local.", Qtype: dns.TypeA,
+ Rcode: dns.RcodeSuccess,
+ Answer: []dns.RR{
+ test.A("172-0-0-2.hdls1.testns.svc.cluster.local. 5 IN A 172.0.0.2"),
+ },
+ },
+ // A pod ip
+ {
+ Qname: "172-0-0-3.hdls1.testns.svc.cluster.local.", Qtype: dns.TypeA,
+ Rcode: dns.RcodeSuccess,
+ Answer: []dns.RR{
+ test.A("172-0-0-3.hdls1.testns.svc.cluster.local. 5 IN A 172.0.0.3"),
+ },
+ },
// SRV Service (Headless)
{
Qname: "_http._tcp.hdls1.testns.svc.cluster.local.", Qtype: dns.TypeSRV,
@@ -102,6 +118,12 @@ var dnsTestCases = []test.Case{
test.AAAA("5678-abcd--2.hdls1.testns.svc.cluster.local. 5 IN AAAA 5678:abcd::2"),
},
},
+ // AAAA
+ {
+ Qname: "5678-abcd--2.hdls1.testns.svc.cluster.local", Qtype: dns.TypeAAAA,
+ Rcode: dns.RcodeSuccess,
+ Answer: []dns.RR{test.AAAA("5678-abcd--2.hdls1.testns.svc.cluster.local. 5 IN AAAA 5678:abcd::2")},
+ },
// CNAME External
{
Qname: "external.testns.svc.cluster.local.", Qtype: dns.TypeCNAME,
@@ -166,6 +188,17 @@ var dnsTestCases = []test.Case{
test.AAAA("svc6.testns.svc.cluster.local. 5 IN AAAA 1234:abcd::1"),
},
},
+ // SRV
+ {
+ Qname: "_http._tcp.svc6.testns.svc.cluster.local.", Qtype: dns.TypeSRV,
+ Rcode: dns.RcodeSuccess,
+ Answer: []dns.RR{
+ test.SRV("_http._tcp.svc6.testns.svc.cluster.local. 5 IN SRV 0 100 80 svc6.testns.svc.cluster.local."),
+ },
+ Extra: []dns.RR{
+ test.AAAA("svc6.testns.svc.cluster.local. 5 IN AAAA 1234:abcd::1"),
+ },
+ },
// AAAA Service (Headless)
{
Qname: "hdls1.testns.svc.cluster.local.", Qtype: dns.TypeAAAA,