diff options
author | 2018-10-11 21:59:50 +0100 | |
---|---|---|
committer | 2018-10-11 16:59:50 -0400 | |
commit | 6ed88fab744bd3d8cc071153a4c78970798cf9e6 (patch) | |
tree | ab4935e8cb81931b65966ba13829f3f8780b12b3 /plugin/kubernetes/ns_test.go | |
parent | c8fb66f8cc60ff17b916b033982c5491f23cdcc9 (diff) | |
download | coredns-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.go | 54 |
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 } |