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 a18a6ae123
.
This commit is contained in:
parent
7b078a885f
commit
79eec38afd
2 changed files with 7 additions and 9 deletions
|
@ -19,8 +19,6 @@ import (
|
||||||
"k8s.io/apimachinery/pkg/watch"
|
"k8s.io/apimachinery/pkg/watch"
|
||||||
)
|
)
|
||||||
|
|
||||||
var namespace = api.NamespaceAll
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
podIPIndex = "PodIP"
|
podIPIndex = "PodIP"
|
||||||
svcNameNamespaceIndex = "NameNamespace"
|
svcNameNamespaceIndex = "NameNamespace"
|
||||||
|
@ -114,8 +112,8 @@ func newdnsController(kubeClient *kubernetes.Clientset, opts dnsControlOpts) *dn
|
||||||
|
|
||||||
dns.svcLister, dns.svcController = cache.NewIndexerInformer(
|
dns.svcLister, dns.svcController = cache.NewIndexerInformer(
|
||||||
&cache.ListWatch{
|
&cache.ListWatch{
|
||||||
ListFunc: serviceListFunc(dns.client, namespace, dns.selector),
|
ListFunc: serviceListFunc(dns.client, api.NamespaceAll, dns.selector),
|
||||||
WatchFunc: serviceWatchFunc(dns.client, namespace, dns.selector),
|
WatchFunc: serviceWatchFunc(dns.client, api.NamespaceAll, dns.selector),
|
||||||
},
|
},
|
||||||
&api.Service{},
|
&api.Service{},
|
||||||
opts.resyncPeriod,
|
opts.resyncPeriod,
|
||||||
|
@ -125,8 +123,8 @@ func newdnsController(kubeClient *kubernetes.Clientset, opts dnsControlOpts) *dn
|
||||||
if opts.initPodCache {
|
if opts.initPodCache {
|
||||||
dns.podLister, dns.podController = cache.NewIndexerInformer(
|
dns.podLister, dns.podController = cache.NewIndexerInformer(
|
||||||
&cache.ListWatch{
|
&cache.ListWatch{
|
||||||
ListFunc: podListFunc(dns.client, namespace, dns.selector),
|
ListFunc: podListFunc(dns.client, api.NamespaceAll, dns.selector),
|
||||||
WatchFunc: podWatchFunc(dns.client, namespace, dns.selector),
|
WatchFunc: podWatchFunc(dns.client, api.NamespaceAll, dns.selector),
|
||||||
},
|
},
|
||||||
&api.Pod{},
|
&api.Pod{},
|
||||||
opts.resyncPeriod,
|
opts.resyncPeriod,
|
||||||
|
@ -137,8 +135,8 @@ func newdnsController(kubeClient *kubernetes.Clientset, opts dnsControlOpts) *dn
|
||||||
if opts.initEndpointsCache {
|
if opts.initEndpointsCache {
|
||||||
dns.epLister, dns.epController = cache.NewIndexerInformer(
|
dns.epLister, dns.epController = cache.NewIndexerInformer(
|
||||||
&cache.ListWatch{
|
&cache.ListWatch{
|
||||||
ListFunc: endpointsListFunc(dns.client, namespace, dns.selector),
|
ListFunc: endpointsListFunc(dns.client, api.NamespaceAll, dns.selector),
|
||||||
WatchFunc: endpointsWatchFunc(dns.client, namespace, dns.selector),
|
WatchFunc: endpointsWatchFunc(dns.client, api.NamespaceAll, dns.selector),
|
||||||
},
|
},
|
||||||
&api.Endpoints{},
|
&api.Endpoints{},
|
||||||
opts.resyncPeriod,
|
opts.resyncPeriod,
|
||||||
|
|
|
@ -414,7 +414,7 @@ func (k *Kubernetes) findServices(r recordRequest, zone string) (services []msg.
|
||||||
err = errNoItems
|
err = errNoItems
|
||||||
if wildcard(r.service) && !wildcard(r.namespace) {
|
if wildcard(r.service) && !wildcard(r.namespace) {
|
||||||
// If namespace exist, err should be nil, so that we return nodata instead of NXDOMAIN
|
// 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
|
err = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue