diff options
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 f331d3231..fd781bc14 100644 --- a/plugin/kubernetes/ns_test.go +++ b/plugin/kubernetes/ns_test.go @@ -3,58 +3,52 @@ package kubernetes import ( "testing" + "github.com/coredns/coredns/plugin/kubernetes/object" "github.com/coredns/coredns/plugin/pkg/watch" api "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) type APIConnTest struct{} -func (APIConnTest) HasSynced() bool { return true } -func (APIConnTest) Run() { return } -func (APIConnTest) Stop() error { return nil } -func (APIConnTest) PodIndex(string) []*api.Pod { return nil } -func (APIConnTest) SvcIndex(string) []*api.Service { return nil } -func (APIConnTest) SvcIndexReverse(string) []*api.Service { return nil } -func (APIConnTest) EpIndex(string) []*api.Endpoints { return nil } -func (APIConnTest) EndpointsList() []*api.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) 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() []*api.Service { - svcs := []*api.Service{ +func (APIConnTest) ServiceList() []*object.Service { + svcs := []*object.Service{ { - ObjectMeta: meta.ObjectMeta{ - Name: "dns-service", - Namespace: "kube-system", - }, - Spec: api.ServiceSpec{ - ClusterIP: "10.0.0.111", - }, + Name: "dns-service", + Namespace: "kube-system", + ClusterIP: "10.0.0.111", }, } return svcs } -func (APIConnTest) EpIndexReverse(string) []*api.Endpoints { - eps := []*api.Endpoints{ +func (APIConnTest) EpIndexReverse(string) []*object.Endpoints { + eps := []*object.Endpoints{ { - Subsets: []api.EndpointSubset{ + Subsets: []object.EndpointSubset{ { - Addresses: []api.EndpointAddress{ + Addresses: []object.EndpointAddress{ { IP: "127.0.0.1", }, }, }, }, - ObjectMeta: meta.ObjectMeta{ - Name: "dns-service", - Namespace: "kube-system", - }, + Name: "dns-service", + Namespace: "kube-system", }, } return eps |