aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/external.go
diff options
context:
space:
mode:
authorGravatar Chris O'Haver <cohaver@infoblox.com> 2022-02-09 09:25:10 -0500
committerGravatar GitHub <noreply@github.com> 2022-02-09 09:25:10 -0500
commitabaf938623eaae632afd8548ebf5fdc5c3197c5a (patch)
treecc3f4f795c779ba9aa993577c1e1d1bb69b2c4bc /plugin/kubernetes/external.go
parent40a526b27ff15291d6ae4a4e5c199ef292210a89 (diff)
downloadcoredns-abaf938623eaae632afd8548ebf5fdc5c3197c5a.tar.gz
coredns-abaf938623eaae632afd8548ebf5fdc5c3197c5a.tar.zst
coredns-abaf938623eaae632afd8548ebf5fdc5c3197c5a.zip
remove wildcard query functionality (#5019)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
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