aboutsummaryrefslogtreecommitdiff
path: root/plugin/k8s_external/msg_to_dns.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/k8s_external/msg_to_dns.go')
-rw-r--r--plugin/k8s_external/msg_to_dns.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugin/k8s_external/msg_to_dns.go b/plugin/k8s_external/msg_to_dns.go
index 8920f4a00..540c8f442 100644
--- a/plugin/k8s_external/msg_to_dns.go
+++ b/plugin/k8s_external/msg_to_dns.go
@@ -10,7 +10,7 @@ import (
"github.com/miekg/dns"
)
-func (e *External) a(ctx context.Context, services []msg.Service, state request.Request) (records []dns.RR) {
+func (e *External) a(ctx context.Context, services []msg.Service, state request.Request) (records []dns.RR, truncated bool) {
dup := make(map[string]struct{})
for _, s := range services {
@@ -23,6 +23,9 @@ func (e *External) a(ctx context.Context, services []msg.Service, state request.
records = append(records, rr)
if resp, err := e.upstream.Lookup(ctx, state, dns.Fqdn(s.Host), dns.TypeA); err == nil {
records = append(records, resp.Answer...)
+ if resp.Truncated {
+ truncated = true
+ }
}
case dns.TypeA:
@@ -37,10 +40,10 @@ func (e *External) a(ctx context.Context, services []msg.Service, state request.
// nada
}
}
- return records
+ return records, truncated
}
-func (e *External) aaaa(ctx context.Context, services []msg.Service, state request.Request) (records []dns.RR) {
+func (e *External) aaaa(ctx context.Context, services []msg.Service, state request.Request) (records []dns.RR, truncated bool) {
dup := make(map[string]struct{})
for _, s := range services {
@@ -53,6 +56,9 @@ func (e *External) aaaa(ctx context.Context, services []msg.Service, state reque
records = append(records, rr)
if resp, err := e.upstream.Lookup(ctx, state, dns.Fqdn(s.Host), dns.TypeAAAA); err == nil {
records = append(records, resp.Answer...)
+ if resp.Truncated {
+ truncated = true
+ }
}
case dns.TypeA:
@@ -67,7 +73,7 @@ func (e *External) aaaa(ctx context.Context, services []msg.Service, state reque
}
}
}
- return records
+ return records, truncated
}
func (e *External) srv(ctx context.Context, services []msg.Service, state request.Request) (records, extra []dns.RR) {