diff options
author | 2022-12-13 20:36:46 +0000 | |
---|---|---|
committer | 2022-12-13 15:36:46 -0500 | |
commit | c3228615e071de61b0c6f60d9a231c494726dda0 (patch) | |
tree | c183d332c7143e7981eca09223568f91c3fbe429 /plugin/kubernetes/handler_test.go | |
parent | 7813b6e09062a1d95d19e305dfed9b7ad81fb1ae (diff) | |
download | coredns-c3228615e071de61b0c6f60d9a231c494726dda0.tar.gz coredns-c3228615e071de61b0c6f60d9a231c494726dda0.tar.zst coredns-c3228615e071de61b0c6f60d9a231c494726dda0.zip |
plugin/kubernetes: error NXDOMAIN for TXT lookups (#5737)
plugin/kubernetes: fix NXDOMAIN/NOERROR responses for TXT queries
Signed-off-by: Laurence Robinson <laurence_robinson@live.co.uk>
Co-authored-by: Laurence Robinson <laurence.robinson@deshaw.com>
Diffstat (limited to 'plugin/kubernetes/handler_test.go')
-rw-r--r-- | plugin/kubernetes/handler_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plugin/kubernetes/handler_test.go b/plugin/kubernetes/handler_test.go index 203c9d943..55a8b8c32 100644 --- a/plugin/kubernetes/handler_test.go +++ b/plugin/kubernetes/handler_test.go @@ -247,6 +247,22 @@ var dnsTestCases = []kubeTestCase{ test.TXT("dns-version.cluster.local 28800 IN TXT 1.1.0"), }, }}, + // A TXT record does not exist but another record for the same FQDN does + {Case: test.Case{ + Qname: "svc1.testns.svc.cluster.local.", Qtype: dns.TypeTXT, + Rcode: dns.RcodeSuccess, + Ns: []dns.RR{ + test.SOA("cluster.local. 5 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 5"), + }, + }}, + // A TXT record does not exist and neither does another record for the same FQDN + {Case: test.Case{ + Qname: "svc0.svc-nons.svc.cluster.local.", Qtype: dns.TypeTXT, + Rcode: dns.RcodeNameError, + Ns: []dns.RR{ + test.SOA("cluster.local. 5 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 5"), + }, + }}, // A Service (Headless) does not exist {Case: test.Case{ Qname: "bogusendpoint.hdls1.testns.svc.cluster.local.", Qtype: dns.TypeA, |