aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/handler.go
diff options
context:
space:
mode:
authorGravatar Chris O'Haver <cohaver@infoblox.com> 2019-08-09 17:14:48 -0400
committerGravatar Miek Gieben <miek@miek.nl> 2019-08-09 21:14:48 +0000
commit3a59c833a09eafd8e67f6ac1686b30193b6220c0 (patch)
tree0a208f057ab54b41ebc5acb8e5b6fac88e384ccb /plugin/kubernetes/handler.go
parent6a6e9a9b33731656b51655072951649d9e716613 (diff)
downloadcoredns-3a59c833a09eafd8e67f6ac1686b30193b6220c0.tar.gz
coredns-3a59c833a09eafd8e67f6ac1686b30193b6220c0.tar.zst
coredns-3a59c833a09eafd8e67f6ac1686b30193b6220c0.zip
plugin/kubernetes: Don't do a zone transfer for NS requests (#3098)
* fix switch order * remove fallthough * add test * fix test * distingush nxdomain/nodata for at least first subdomain of zone * restore fallthough; reorder switch cases
Diffstat (limited to 'plugin/kubernetes/handler.go')
-rw-r--r--plugin/kubernetes/handler.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/kubernetes/handler.go b/plugin/kubernetes/handler.go
index 324e08da6..a7df99d90 100644
--- a/plugin/kubernetes/handler.go
+++ b/plugin/kubernetes/handler.go
@@ -28,6 +28,8 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
)
switch state.QType() {
+ case dns.TypeAXFR, dns.TypeIXFR:
+ k.Transfer(ctx, state)
case dns.TypeA:
records, err = plugin.A(ctx, &k, zone, state, nil, plugin.Options{})
case dns.TypeAAAA:
@@ -50,8 +52,6 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
break
}
fallthrough
- case dns.TypeAXFR, dns.TypeIXFR:
- k.Transfer(ctx, state)
default:
// Do a fake A lookup, so we can distinguish between NODATA and NXDOMAIN
_, err = plugin.A(ctx, &k, zone, state, nil, plugin.Options{})