aboutsummaryrefslogtreecommitdiff
path: root/plugin/federation/kubernetes_api_test.go
diff options
context:
space:
mode:
authorGravatar Yong Tang <yong.tang.github@outlook.com> 2019-08-18 14:41:51 -0700
committerGravatar GitHub <noreply@github.com> 2019-08-18 14:41:51 -0700
commit6402cef3371b6a5716dd032e2484d865cf25338a (patch)
tree3d53847a82db477f9e2e8dea16b0015d5695703e /plugin/federation/kubernetes_api_test.go
parentbbf148360b2bd35b9a1e358fdf7984a33b15a8d5 (diff)
downloadcoredns-6402cef3371b6a5716dd032e2484d865cf25338a.tar.gz
coredns-6402cef3371b6a5716dd032e2484d865cf25338a.tar.zst
coredns-6402cef3371b6a5716dd032e2484d865cf25338a.zip
Move federation plugin to github.com/coredns/federation (#3139)
* Remove federation Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Rebuild and point to github.com/coredns/federation Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Export `localNodeName` => `LocalNodeName`, to be used by federation (until deprecation) Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Remove plugin/kubernetes/federation.go (=> kubernetes/federation repo) Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update github.com/coredns/federation Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * sticker-ci fix Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Diffstat (limited to 'plugin/federation/kubernetes_api_test.go')
-rw-r--r--plugin/federation/kubernetes_api_test.go140
1 files changed, 0 insertions, 140 deletions
diff --git a/plugin/federation/kubernetes_api_test.go b/plugin/federation/kubernetes_api_test.go
deleted file mode 100644
index 35b058b07..000000000
--- a/plugin/federation/kubernetes_api_test.go
+++ /dev/null
@@ -1,140 +0,0 @@
-package federation
-
-import (
- "github.com/coredns/coredns/plugin/kubernetes"
- "github.com/coredns/coredns/plugin/kubernetes/object"
-
- api "k8s.io/api/core/v1"
- meta "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-type APIConnFederationTest struct {
- zone, region string
-}
-
-func (APIConnFederationTest) HasSynced() bool { return true }
-func (APIConnFederationTest) Run() { return }
-func (APIConnFederationTest) Stop() error { return nil }
-func (APIConnFederationTest) SvcIndexReverse(string) []*object.Service { return nil }
-func (APIConnFederationTest) EpIndexReverse(string) []*object.Endpoints { return nil }
-func (APIConnFederationTest) Modified() int64 { return 0 }
-
-func (APIConnFederationTest) PodIndex(string) []*object.Pod {
- return []*object.Pod{
- {Namespace: "podns", PodIP: "10.240.0.1"}, // Remote IP set in test.ResponseWriter
- }
-}
-
-func (APIConnFederationTest) SvcIndex(string) []*object.Service {
- svcs := []*object.Service{
- {
- Name: "svc1",
- Namespace: "testns",
- ClusterIP: "10.0.0.1",
- Ports: []api.ServicePort{
- {Name: "http", Protocol: "tcp", Port: 80},
- },
- },
- {
- Name: "hdls1",
- Namespace: "testns",
- ClusterIP: api.ClusterIPNone,
- },
- {
- Name: "external",
- Namespace: "testns",
- ExternalName: "ext.interwebs.test",
- Ports: []api.ServicePort{
- {Name: "http", Protocol: "tcp", Port: 80},
- },
- },
- }
- return svcs
-}
-
-func (APIConnFederationTest) ServiceList() []*object.Service {
- svcs := []*object.Service{
- {
- Name: "svc1",
- Namespace: "testns",
- ClusterIP: "10.0.0.1",
- Ports: []api.ServicePort{
- {Name: "http", Protocol: "tcp", Port: 80},
- },
- },
- {
- Name: "hdls1",
- Namespace: "testns",
- ClusterIP: api.ClusterIPNone,
- },
- {
- Name: "external",
- Namespace: "testns",
- ExternalName: "ext.interwebs.test",
- Ports: []api.ServicePort{
- {Name: "http", Protocol: "tcp", Port: 80},
- },
- },
- }
- return svcs
-}
-
-func (APIConnFederationTest) EpIndex(string) []*object.Endpoints {
- eps := []*object.Endpoints{
- {
- Subsets: []object.EndpointSubset{
- {
- Addresses: []object.EndpointAddress{
- {IP: "172.0.0.1", Hostname: "ep1a"},
- },
- Ports: []object.EndpointPort{
- {Port: 80, Protocol: "tcp", Name: "http"},
- },
- },
- },
- Name: "svc1",
- Namespace: "testns",
- },
- }
- return eps
-}
-
-func (APIConnFederationTest) EndpointsList() []*object.Endpoints {
- eps := []*object.Endpoints{
- {
- Subsets: []object.EndpointSubset{
- {
- Addresses: []object.EndpointAddress{
- {IP: "172.0.0.1", Hostname: "ep1a"},
- },
- Ports: []object.EndpointPort{
- {Port: 80, Protocol: "tcp", Name: "http"},
- },
- },
- },
- Name: "svc1",
- Namespace: "testns",
- },
- }
- return eps
-}
-
-func (a APIConnFederationTest) GetNodeByName(name string) (*api.Node, error) {
- return &api.Node{
- ObjectMeta: meta.ObjectMeta{
- Name: "test.node.foo.bar",
- Labels: map[string]string{
- kubernetes.LabelRegion: a.region,
- kubernetes.LabelZone: a.zone,
- },
- },
- }, nil
-}
-
-func (APIConnFederationTest) GetNamespaceByName(name string) (*api.Namespace, error) {
- return &api.Namespace{
- ObjectMeta: meta.ObjectMeta{
- Name: name,
- },
- }, nil
-}