Allow cidr based reverse zone config (#500)
* add cidrs opt * remove state data from middleware object
This commit is contained in:
parent
3a04d2a306
commit
8beb1b2166
3 changed files with 33 additions and 1 deletions
|
@ -26,7 +26,12 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
|
|||
// otherwise delegate to the next in the pipeline.
|
||||
zone := middleware.Zones(k.Zones).Matches(state.Name())
|
||||
if zone == "" {
|
||||
return middleware.NextOrFailure(k.Name(), k.Next, ctx, w, r)
|
||||
// If this is a PTR request, and a the request is in a defined
|
||||
// pod/service cidr range, process the request in this middleware,
|
||||
// otherwise pass to next middleware.
|
||||
if state.Type() != "PTR" || !k.IsRequestInReverseRange(state) {
|
||||
return middleware.NextOrFailure(k.Name(), k.Next, ctx, w, r)
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue