mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Fix k8s PTR when all namespaces exposed (#507)
* check for no namespace filter * integration test
This commit is contained in:
committed by
John Belamaric
parent
89dc5720d0
commit
4b6860fc81
@@ -508,7 +508,7 @@ func (k *Kubernetes) getServiceRecordForIP(ip, name string) []msg.Service {
|
||||
return nil
|
||||
}
|
||||
for _, service := range svcList {
|
||||
if !dnsstrings.StringInSlice(service.Namespace, k.Namespaces) {
|
||||
if (len(k.Namespaces) > 0) && !dnsstrings.StringInSlice(service.Namespace, k.Namespaces) {
|
||||
continue
|
||||
}
|
||||
if service.Spec.ClusterIP == ip {
|
||||
@@ -522,7 +522,7 @@ func (k *Kubernetes) getServiceRecordForIP(ip, name string) []msg.Service {
|
||||
return nil
|
||||
}
|
||||
for _, ep := range epList.Items {
|
||||
if !dnsstrings.StringInSlice(ep.ObjectMeta.Namespace, k.Namespaces) {
|
||||
if (len(k.Namespaces) > 0) && !dnsstrings.StringInSlice(ep.ObjectMeta.Namespace, k.Namespaces) {
|
||||
continue
|
||||
}
|
||||
for _, eps := range ep.Subsets {
|
||||
|
||||
Reference in New Issue
Block a user