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.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugin/kubernetes/handler_test.go b/plugin/kubernetes/handler_test.go
index 63e691cf2..b23953b32 100644
--- a/plugin/kubernetes/handler_test.go
+++ b/plugin/kubernetes/handler_test.go
@@ -2,6 +2,7 @@ package kubernetes
import (
"testing"
+ "time"
"github.com/coredns/coredns/plugin/pkg/dnstest"
"github.com/coredns/coredns/plugin/test"
@@ -35,6 +36,12 @@ var dnsTestCases = []test.Case{
Answer: []dns.RR{test.SRV("svc1.testns.svc.cluster.local. 5 IN SRV 0 100 80 svc1.testns.svc.cluster.local.")},
Extra: []dns.RR{test.A("svc1.testns.svc.cluster.local. 5 IN A 10.0.0.1")},
},
+ {
+ Qname: "svc6.testns.svc.cluster.local.", Qtype: dns.TypeSRV,
+ Rcode: dns.RcodeSuccess,
+ Answer: []dns.RR{test.SRV("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")},
+ },
// SRV Service (wildcard)
{
Qname: "svc1.*.svc.cluster.local.", Qtype: dns.TypeSRV,
@@ -266,6 +273,7 @@ func (APIConnServeTest) Run() { return }
func (APIConnServeTest) Stop() error { return nil }
func (APIConnServeTest) EpIndexReverse(string) []*api.Endpoints { return nil }
func (APIConnServeTest) SvcIndexReverse(string) []*api.Service { return nil }
+func (APIConnServeTest) Modified() int64 { return time.Now().Unix() }
func (APIConnServeTest) PodIndex(string) []*api.Pod {
a := []*api.Pod{{
@@ -286,6 +294,7 @@ var svcIndex = map[string][]*api.Service{
Namespace: "testns",
},
Spec: api.ServiceSpec{
+ Type: api.ServiceTypeClusterIP,
ClusterIP: "10.0.0.1",
Ports: []api.ServicePort{{
Name: "http",
@@ -300,6 +309,7 @@ var svcIndex = map[string][]*api.Service{
Namespace: "testns",
},
Spec: api.ServiceSpec{
+ Type: api.ServiceTypeClusterIP,
ClusterIP: "1234:abcd::1",
Ports: []api.ServicePort{{
Name: "http",
@@ -314,6 +324,7 @@ var svcIndex = map[string][]*api.Service{
Namespace: "testns",
},
Spec: api.ServiceSpec{
+ Type: api.ServiceTypeClusterIP,
ClusterIP: api.ClusterIPNone,
},
}},