mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 01:04:15 -04:00
dont match external services when endpoint is specified (#5734)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
@@ -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}, "/")
|
||||
|
||||
Reference in New Issue
Block a user