aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/ns_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-10-11 21:59:50 +0100
committerGravatar Chris O'Haver <cohaver@infoblox.com> 2018-10-11 16:59:50 -0400
commit6ed88fab744bd3d8cc071153a4c78970798cf9e6 (patch)
treeab4935e8cb81931b65966ba13829f3f8780b12b3 /plugin/kubernetes/ns_test.go
parentc8fb66f8cc60ff17b916b033982c5491f23cdcc9 (diff)
downloadcoredns-6ed88fab744bd3d8cc071153a4c78970798cf9e6.tar.gz
coredns-6ed88fab744bd3d8cc071153a4c78970798cf9e6.tar.zst
coredns-6ed88fab744bd3d8cc071153a4c78970798cf9e6.zip
Revert "use keys (#2167)" (#2188)
This reverts commit 974ed086f25ad45a01947e276e2eb8aa73d007a3.
Diffstat (limited to 'plugin/kubernetes/ns_test.go')
-rw-r--r--plugin/kubernetes/ns_test.go54
1 files changed, 24 insertions, 30 deletions
diff --git a/plugin/kubernetes/ns_test.go b/plugin/kubernetes/ns_test.go
index c9025288b..fd781bc14 100644
--- a/plugin/kubernetes/ns_test.go
+++ b/plugin/kubernetes/ns_test.go
@@ -11,26 +11,18 @@ import (
type APIConnTest struct{}
-func (APIConnTest) HasSynced() bool { return true }
-func (APIConnTest) Run() { return }
-func (APIConnTest) Stop() error { return nil }
-func (APIConnTest) PodIndex(string) []*object.Pod { return nil }
-func (APIConnTest) SvcIndexReverse(string) *object.Service { return nil }
-func (APIConnTest) EpIndex(string) *object.Endpoints { return nil }
-func (APIConnTest) EndpointsList() []*object.Endpoints { return nil }
-func (APIConnTest) Modified() int64 { return 0 }
-func (APIConnTest) SetWatchChan(watch.Chan) {}
-func (APIConnTest) Watch(string) error { return nil }
-func (APIConnTest) StopWatching(string) {}
-
-func (a APIConnTest) SvcIndex(key string) *object.Service {
- for _, s := range a.ServiceList() {
- if object.ServiceKey(s.Namespace, s.Name) == key {
- return s
- }
- }
- return nil
-}
+func (APIConnTest) HasSynced() bool { return true }
+func (APIConnTest) Run() { return }
+func (APIConnTest) Stop() error { return nil }
+func (APIConnTest) PodIndex(string) []*object.Pod { return nil }
+func (APIConnTest) SvcIndex(string) []*object.Service { return nil }
+func (APIConnTest) SvcIndexReverse(string) []*object.Service { return nil }
+func (APIConnTest) EpIndex(string) []*object.Endpoints { return nil }
+func (APIConnTest) EndpointsList() []*object.Endpoints { return nil }
+func (APIConnTest) Modified() int64 { return 0 }
+func (APIConnTest) SetWatchChan(watch.Chan) {}
+func (APIConnTest) Watch(string) error { return nil }
+func (APIConnTest) StopWatching(string) {}
func (APIConnTest) ServiceList() []*object.Service {
svcs := []*object.Service{
@@ -43,21 +35,23 @@ func (APIConnTest) ServiceList() []*object.Service {
return svcs
}
-func (APIConnTest) EpIndexReverse(string) *object.Endpoints {
- eps := object.Endpoints{
- Subsets: []object.EndpointSubset{
- {
- Addresses: []object.EndpointAddress{
- {
- IP: "127.0.0.1",
+func (APIConnTest) EpIndexReverse(string) []*object.Endpoints {
+ eps := []*object.Endpoints{
+ {
+ Subsets: []object.EndpointSubset{
+ {
+ Addresses: []object.EndpointAddress{
+ {
+ IP: "127.0.0.1",
+ },
},
},
},
+ Name: "dns-service",
+ Namespace: "kube-system",
},
- Name: "dns-service",
- Namespace: "kube-system",
}
- return &eps
+ return eps
}
func (APIConnTest) GetNodeByName(name string) (*api.Node, error) { return &api.Node{}, nil }