mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
plugin/k8s_external: Resolve headless services (#5505)
*add option for resolving headless Services without external IPs in k8s_external Signed-off-by: Tomas Kohout <tomas.kohout1995@gmail.com>
This commit is contained in:
@@ -112,7 +112,7 @@ func (k *Kubernetes) Services(ctx context.Context, state request.Request, exact
|
||||
|
||||
case dns.TypeNS:
|
||||
// We can only get here if the qname equals the zone, see ServeDNS in handler.go.
|
||||
nss := k.nsAddrs(false, state.Zone)
|
||||
nss := k.nsAddrs(false, false, state.Zone)
|
||||
var svcs []msg.Service
|
||||
for _, ns := range nss {
|
||||
if ns.Header().Rrtype == dns.TypeA {
|
||||
@@ -127,7 +127,7 @@ func (k *Kubernetes) Services(ctx context.Context, state request.Request, exact
|
||||
}
|
||||
|
||||
if isDefaultNS(state.Name(), state.Zone) {
|
||||
nss := k.nsAddrs(false, state.Zone)
|
||||
nss := k.nsAddrs(false, false, state.Zone)
|
||||
var svcs []msg.Service
|
||||
for _, ns := range nss {
|
||||
if ns.Header().Rrtype == dns.TypeA && state.QType() == dns.TypeA {
|
||||
|
||||
Reference in New Issue
Block a user