diff options
author | 2018-09-22 16:08:21 +0100 | |
---|---|---|
committer | 2018-09-22 16:08:21 +0100 | |
commit | 79eec38afdbbf358a447431338b0c1241977a974 (patch) | |
tree | 8065ac101b7d3d56cd1da4f6223db00e99b57957 /plugin/kubernetes | |
parent | 7b078a885f4948592dcaa14d528aab73d9f41110 (diff) | |
download | coredns-79eec38afdbbf358a447431338b0c1241977a974.tar.gz coredns-79eec38afdbbf358a447431338b0c1241977a974.tar.zst coredns-79eec38afdbbf358a447431338b0c1241977a974.zip |
plugin/kubernetes: remove var namespace (#2122)
* WIP: trying stuff out
Signed-off-by: Miek Gieben <miek@miek.nl>
* Fixes
Signed-off-by: Miek Gieben <miek@miek.nl>
* Revert "WIP: trying stuff out"
This reverts commit a18a6ae1233d5f34c98164fd693294c36b3240b7.
Diffstat (limited to 'plugin/kubernetes')
-rw-r--r-- | plugin/kubernetes/controller.go | 14 | ||||
-rw-r--r-- | plugin/kubernetes/kubernetes.go | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/plugin/kubernetes/controller.go b/plugin/kubernetes/controller.go index db231c89d..559262e26 100644 --- a/plugin/kubernetes/controller.go +++ b/plugin/kubernetes/controller.go @@ -19,8 +19,6 @@ import ( "k8s.io/apimachinery/pkg/watch" ) -var namespace = api.NamespaceAll - const ( podIPIndex = "PodIP" svcNameNamespaceIndex = "NameNamespace" @@ -114,8 +112,8 @@ func newdnsController(kubeClient *kubernetes.Clientset, opts dnsControlOpts) *dn dns.svcLister, dns.svcController = cache.NewIndexerInformer( &cache.ListWatch{ - ListFunc: serviceListFunc(dns.client, namespace, dns.selector), - WatchFunc: serviceWatchFunc(dns.client, namespace, dns.selector), + ListFunc: serviceListFunc(dns.client, api.NamespaceAll, dns.selector), + WatchFunc: serviceWatchFunc(dns.client, api.NamespaceAll, dns.selector), }, &api.Service{}, opts.resyncPeriod, @@ -125,8 +123,8 @@ func newdnsController(kubeClient *kubernetes.Clientset, opts dnsControlOpts) *dn if opts.initPodCache { dns.podLister, dns.podController = cache.NewIndexerInformer( &cache.ListWatch{ - ListFunc: podListFunc(dns.client, namespace, dns.selector), - WatchFunc: podWatchFunc(dns.client, namespace, dns.selector), + ListFunc: podListFunc(dns.client, api.NamespaceAll, dns.selector), + WatchFunc: podWatchFunc(dns.client, api.NamespaceAll, dns.selector), }, &api.Pod{}, opts.resyncPeriod, @@ -137,8 +135,8 @@ func newdnsController(kubeClient *kubernetes.Clientset, opts dnsControlOpts) *dn if opts.initEndpointsCache { dns.epLister, dns.epController = cache.NewIndexerInformer( &cache.ListWatch{ - ListFunc: endpointsListFunc(dns.client, namespace, dns.selector), - WatchFunc: endpointsWatchFunc(dns.client, namespace, dns.selector), + ListFunc: endpointsListFunc(dns.client, api.NamespaceAll, dns.selector), + WatchFunc: endpointsWatchFunc(dns.client, api.NamespaceAll, dns.selector), }, &api.Endpoints{}, opts.resyncPeriod, diff --git a/plugin/kubernetes/kubernetes.go b/plugin/kubernetes/kubernetes.go index 9eac7d467..9c5089bd7 100644 --- a/plugin/kubernetes/kubernetes.go +++ b/plugin/kubernetes/kubernetes.go @@ -414,7 +414,7 @@ func (k *Kubernetes) findServices(r recordRequest, zone string) (services []msg. err = errNoItems if wildcard(r.service) && !wildcard(r.namespace) { // If namespace exist, err should be nil, so that we return nodata instead of NXDOMAIN - if k.namespace(namespace) { + if k.namespace(r.namespace) { err = nil } } |