aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/external.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/kubernetes/external.go')
-rw-r--r--plugin/kubernetes/external.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/plugin/kubernetes/external.go b/plugin/kubernetes/external.go
index 42495a430..77fa0ef58 100644
--- a/plugin/kubernetes/external.go
+++ b/plugin/kubernetes/external.go
@@ -24,11 +24,7 @@ func (k *Kubernetes) External(state request.Request) ([]msg.Service, int) {
// We are dealing with a fairly normal domain name here, but we still need to have the service
// and the namespace:
// service.namespace.<base>
- //
- // for service (and SRV) you can also say _tcp, and port (i.e. _http), we need those be picked
- // up, unless they are not specified, then we use an internal wildcard.
- port := "*"
- protocol := "*"
+ var port, protocol string
namespace := segs[last]
if !k.namespaceExposed(namespace) {
return nil, dns.RcodeNameError
@@ -69,7 +65,7 @@ func (k *Kubernetes) External(state request.Request) ([]msg.Service, int) {
for _, ip := range svc.ExternalIPs {
for _, p := range svc.Ports {
- if !(match(port, p.Name) && match(protocol, string(p.Protocol))) {
+ if !(matchPortAndProtocol(port, p.Name, protocol, string(p.Protocol))) {
continue
}
rcode = dns.RcodeSuccess