diff options
author | 2018-11-16 14:42:49 +0100 | |
---|---|---|
committer | 2018-11-16 08:42:49 -0500 | |
commit | 8dbe1fbee227d6830d61a169eb947f4c243c76d6 (patch) | |
tree | 31b34683a80a659e76e2076865d76a77ef48dbea /plugin/kubernetes/handler_test.go | |
parent | 3f6dfba1f0e9cd6c858f88891550d09904b7814d (diff) | |
download | coredns-8dbe1fbee227d6830d61a169eb947f4c243c76d6.tar.gz coredns-8dbe1fbee227d6830d61a169eb947f4c243c76d6.tar.zst coredns-8dbe1fbee227d6830d61a169eb947f4c243c76d6.zip |
Set SOA record TTL as min of TTL/MINIMUM (#2295)
* Set SOA record TTL as min of TTL/MINIMUM
According to
https://tools.ietf.org/html/rfc2308#section-3:
The TTL of this record is set from the minimum
of the MINIMUM field of the SOA record and the
TTL of the SOA itself, and indicates how long a
resolver may cache the negative answer.
Set the TTL accordingly so as to not always
negative cache SOA records for 300 seconds.
* Inline min func
* Update SOA record tests
* Fix types
Diffstat (limited to 'plugin/kubernetes/handler_test.go')
-rw-r--r-- | plugin/kubernetes/handler_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugin/kubernetes/handler_test.go b/plugin/kubernetes/handler_test.go index 38047e64d..3efdbe031 100644 --- a/plugin/kubernetes/handler_test.go +++ b/plugin/kubernetes/handler_test.go @@ -90,7 +90,7 @@ var dnsTestCases = []test.Case{ Qname: "*._not-udp-or-tcp.svc1.testns.svc.cluster.local.", Qtype: dns.TypeSRV, Rcode: dns.RcodeNameError, Ns: []dns.RR{ - test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + test.SOA("cluster.local. 30 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, }, // SRV Service @@ -201,7 +201,7 @@ var dnsTestCases = []test.Case{ Qname: "*.*.hdlsprtls.testns.svc.cluster.local.", Qtype: dns.TypeSRV, Rcode: dns.RcodeSuccess, Ns: []dns.RR{ - test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + test.SOA("cluster.local. 30 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, }, // AAAA @@ -232,7 +232,7 @@ var dnsTestCases = []test.Case{ Qname: "svc1.testns.svc.cluster.local.", Qtype: dns.TypeAAAA, Rcode: dns.RcodeSuccess, Ns: []dns.RR{ - test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + test.SOA("cluster.local. 30 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, }, // AAAA Service (non-existing service) @@ -240,7 +240,7 @@ var dnsTestCases = []test.Case{ Qname: "svc0.testns.svc.cluster.local.", Qtype: dns.TypeAAAA, Rcode: dns.RcodeNameError, Ns: []dns.RR{ - test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + test.SOA("cluster.local. 30 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, }, // A Service (non-existing service) @@ -248,7 +248,7 @@ var dnsTestCases = []test.Case{ Qname: "svc0.testns.svc.cluster.local.", Qtype: dns.TypeA, Rcode: dns.RcodeNameError, Ns: []dns.RR{ - test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + test.SOA("cluster.local. 30 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, }, // A Service (non-existing namespace) @@ -256,7 +256,7 @@ var dnsTestCases = []test.Case{ Qname: "svc0.svc-nons.svc.cluster.local.", Qtype: dns.TypeA, Rcode: dns.RcodeNameError, Ns: []dns.RR{ - test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + test.SOA("cluster.local. 30 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, }, // TXT Schema @@ -272,7 +272,7 @@ var dnsTestCases = []test.Case{ Qname: "bogusendpoint.hdls1.testns.svc.cluster.local.", Qtype: dns.TypeA, Rcode: dns.RcodeNameError, Ns: []dns.RR{ - test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + test.SOA("cluster.local. 30 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, }, // A Service does not exist @@ -280,7 +280,7 @@ var dnsTestCases = []test.Case{ Qname: "bogusendpoint.svc0.testns.svc.cluster.local.", Qtype: dns.TypeA, Rcode: dns.RcodeNameError, Ns: []dns.RR{ - test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + test.SOA("cluster.local. 30 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, }, // AAAA Service |