From 47c99dc73b8b77fb2edda060f11780eb022e8bfa Mon Sep 17 00:00:00 2001 From: Chris O'Haver Date: Fri, 4 Nov 2022 09:54:57 -0400 Subject: dont match external services when endpoint is specified (#5734) Signed-off-by: Chris O'Haver --- plugin/kubernetes/kubernetes.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugin/kubernetes/kubernetes.go') diff --git a/plugin/kubernetes/kubernetes.go b/plugin/kubernetes/kubernetes.go index 10d8b7e90..ec0d5a4b1 100644 --- a/plugin/kubernetes/kubernetes.go +++ b/plugin/kubernetes/kubernetes.go @@ -517,6 +517,10 @@ 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 != "" { + continue + } s := msg.Service{Key: strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name}, "/"), Host: svc.ExternalName, TTL: k.ttl} if t, _ := s.HostType(); t == dns.TypeCNAME { s.Key = strings.Join([]string{zonePath, Svc, svc.Namespace, svc.Name}, "/") -- cgit v1.2.3