plugin/kubernetes: fix case preservation and add test (#2430)
* fix case preservation and add test * only fix case in k8s
This commit is contained in:
parent
418edd2a2f
commit
18f25dbef3
3 changed files with 76 additions and 4 deletions
|
@ -18,11 +18,12 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
|
|||
m.SetReply(r)
|
||||
m.Authoritative = true
|
||||
|
||||
zone := plugin.Zones(k.Zones).Matches(state.Name())
|
||||
qname := state.QName()
|
||||
zone := plugin.Zones(k.Zones).Matches(qname)
|
||||
if zone == "" {
|
||||
return plugin.NextOrFailure(k.Name(), k.Next, ctx, w, r)
|
||||
}
|
||||
|
||||
zone = qname[len(qname)-len(zone):] // maintain case of original query
|
||||
state.Zone = zone
|
||||
|
||||
var (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue