diff options
Diffstat (limited to 'plugin/kubernetes')
-rw-r--r-- | plugin/kubernetes/controller.go | 18 | ||||
-rw-r--r-- | plugin/kubernetes/namespace_test.go | 26 |
2 files changed, 22 insertions, 22 deletions
diff --git a/plugin/kubernetes/controller.go b/plugin/kubernetes/controller.go index 233d6f548..6124a19cb 100644 --- a/plugin/kubernetes/controller.go +++ b/plugin/kubernetes/controller.go @@ -53,7 +53,7 @@ type dnsControl struct { client kubernetes.Interface - selector labels.Selector + selector labels.Selector namespaceSelector labels.Selector svcController cache.Controller @@ -84,10 +84,10 @@ type dnsControlOpts struct { ignoreEmptyService bool // Label handling. - labelSelector *meta.LabelSelector - selector labels.Selector + labelSelector *meta.LabelSelector + selector labels.Selector namespaceLabelSelector *meta.LabelSelector - namespaceSelector labels.Selector + namespaceSelector labels.Selector zones []string endpointNameMode bool @@ -96,12 +96,12 @@ type dnsControlOpts struct { // newDNSController creates a controller for CoreDNS. func newdnsController(kubeClient kubernetes.Interface, opts dnsControlOpts) *dnsControl { dns := dnsControl{ - client: kubeClient, - selector: opts.selector, + client: kubeClient, + selector: opts.selector, namespaceSelector: opts.namespaceSelector, - stopCh: make(chan struct{}), - zones: opts.zones, - endpointNameMode: opts.endpointNameMode, + stopCh: make(chan struct{}), + zones: opts.zones, + endpointNameMode: opts.endpointNameMode, } dns.svcLister, dns.svcController = object.NewIndexerInformer( diff --git a/plugin/kubernetes/namespace_test.go b/plugin/kubernetes/namespace_test.go index d7d2cbcce..c302b42ac 100644 --- a/plugin/kubernetes/namespace_test.go +++ b/plugin/kubernetes/namespace_test.go @@ -5,13 +5,13 @@ import ( ) func TestFilteredNamespaceExists(t *testing.T) { - tests := []struct{ + tests := []struct { expected bool kubernetesNamespaces map[string]struct{} testNamespace string }{ - {true, map[string]struct{}{}, "foobar" }, - {false, map[string]struct{}{}, "nsnoexist" }, + {true, map[string]struct{}{}, "foobar"}, + {false, map[string]struct{}{}, "nsnoexist"}, } k := Kubernetes{} @@ -26,15 +26,15 @@ func TestFilteredNamespaceExists(t *testing.T) { } func TestNamespaceExposed(t *testing.T) { - tests := []struct{ + tests := []struct { expected bool kubernetesNamespaces map[string]struct{} testNamespace string }{ - {true, map[string]struct{}{ "foobar": {} }, "foobar" }, - {false, map[string]struct{}{ "foobar": {} }, "nsnoexist" }, - {true, map[string]struct{}{}, "foobar" }, - {true, map[string]struct{}{}, "nsnoexist" }, + {true, map[string]struct{}{"foobar": {}}, "foobar"}, + {false, map[string]struct{}{"foobar": {}}, "nsnoexist"}, + {true, map[string]struct{}{}, "foobar"}, + {true, map[string]struct{}{}, "nsnoexist"}, } k := Kubernetes{} @@ -49,15 +49,15 @@ func TestNamespaceExposed(t *testing.T) { } func TestNamespaceValid(t *testing.T) { - tests := []struct{ + tests := []struct { expected bool kubernetesNamespaces map[string]struct{} testNamespace string }{ - {true, map[string]struct{}{ "foobar": {} }, "foobar" }, - {false, map[string]struct{}{ "foobar": {} }, "nsnoexist" }, - {true, map[string]struct{}{}, "foobar" }, - {false, map[string]struct{}{}, "nsnoexist" }, + {true, map[string]struct{}{"foobar": {}}, "foobar"}, + {false, map[string]struct{}{"foobar": {}}, "nsnoexist"}, + {true, map[string]struct{}{}, "foobar"}, + {false, map[string]struct{}{}, "nsnoexist"}, } k := Kubernetes{} |