From 5b5a6ac6ad94e9ef1e23bd76a2cd1f3987cbe8df Mon Sep 17 00:00:00 2001 From: Dan Wilson Date: Mon, 19 Jun 2023 05:42:17 -0700 Subject: plugin/kubernetes: filter ExternalName services from matching double subdomain wildcard (#6162) remove double subdomain reference from review feedback not subdoman Signed-off-by: emaildanwilson Co-authored-by: emaildanwilson --- plugin/kubernetes/kubernetes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugin/kubernetes/kubernetes.go') diff --git a/plugin/kubernetes/kubernetes.go b/plugin/kubernetes/kubernetes.go index 14ea031a0..cea23d860 100644 --- a/plugin/kubernetes/kubernetes.go +++ b/plugin/kubernetes/kubernetes.go @@ -445,8 +445,8 @@ func (k *Kubernetes) findServices(r recordRequest, zone string) (services []msg. // External service if svc.Type == api.ServiceTypeExternalName { - //External services cannot have endpoints, so skip this service if an endpoint is present in the request - if r.endpoint != "" { + // External services do not have endpoints, nor can we accept port/protocol pseudo subdomains in an SRV query, so skip this service if endpoint, port, or protocol is non-empty in the request + if r.endpoint != "" || r.port != "" || r.protocol != "" { continue } s := msg.Service{Key: strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name}, "/"), Host: svc.ExternalName, TTL: k.ttl} -- cgit v1.2.3