mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 09:14:17 -04:00
mw/kubernetes: rewrite parseRequest
Stop looking at the qtype in parseRequest and make k.Namespace a map. Fallout from this is that pkg/strings as it is not used anymore. Also add a few helper functions to make unexposed namespaces easier to see in the code. Add wildcard tests to the middleware tests.
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
)
|
||||
|
||||
var dnsTestCases = map[string](test.Case){
|
||||
// *.any.svc-1-a.*.svc.cluster.local.,
|
||||
"A Service": {
|
||||
Qname: "svc1.testns.svc.cluster.local.", Qtype: dns.TypeA,
|
||||
Rcode: dns.RcodeSuccess,
|
||||
@@ -19,6 +20,27 @@ var dnsTestCases = map[string](test.Case){
|
||||
test.A("svc1.testns.svc.cluster.local. 0 IN A 10.0.0.1"),
|
||||
},
|
||||
},
|
||||
"A Service (wildcard)": {
|
||||
Qname: "svc1.*.svc.cluster.local.", Qtype: dns.TypeA,
|
||||
Rcode: dns.RcodeSuccess,
|
||||
Answer: []dns.RR{
|
||||
test.A("svc1.testns.svc.cluster.local. 0 IN A 10.0.0.1"),
|
||||
},
|
||||
},
|
||||
"SRV Service (wildcards)": {
|
||||
Qname: "*.any.svc1.*.svc.cluster.local.", Qtype: dns.TypeSRV,
|
||||
Rcode: dns.RcodeSuccess,
|
||||
Answer: []dns.RR{
|
||||
test.A("svc1.testns.svc.cluster.local. 0 IN A 10.0.0.1"),
|
||||
},
|
||||
},
|
||||
"A Service (wildcards)": {
|
||||
Qname: "*.any.svc1.*.svc.cluster.local.", Qtype: dns.TypeA,
|
||||
Rcode: dns.RcodeSuccess,
|
||||
Answer: []dns.RR{
|
||||
test.A("svc1.testns.svc.cluster.local. 0 IN A 10.0.0.1"),
|
||||
},
|
||||
},
|
||||
"A Service (Headless)": {
|
||||
Qname: "hdls1.testns.svc.cluster.local.", Qtype: dns.TypeA,
|
||||
Rcode: dns.RcodeSuccess,
|
||||
|
||||
Reference in New Issue
Block a user