Add pkg/fall for Fallthrough (#1355)
* Add pkg/fall for Fallthrough Move this into it's own package to facilitate tests. Important bug was fixed: make the names fully qualified. Add fall package to hosts, reverse, etcd, and fix kubernetes and any tests. The k8s tests are still as-is, might need a future cleanup.
This commit is contained in:
parent
84ebbbc722
commit
c6febe6250
22 changed files with 217 additions and 110 deletions
|
@ -83,21 +83,6 @@ func NextOrFailure(name string, next Handler, ctx context.Context, w dns.Respons
|
|||
return dns.RcodeServerFailure, Error(name, errors.New("no next plugin found"))
|
||||
}
|
||||
|
||||
// Fallthrough handles the fallthrough logic used in plugins that support it
|
||||
func Fallthrough(ftzones *[]string, qname string) bool {
|
||||
if ftzones == nil {
|
||||
return false
|
||||
}
|
||||
if len(*ftzones) == 0 {
|
||||
return true
|
||||
}
|
||||
zone := Zones(*ftzones).Matches(qname)
|
||||
if zone != "" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// ClientWrite returns true if the response has been written to the client.
|
||||
// Each plugin to adhire to this protocol.
|
||||
func ClientWrite(rcode int) bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue