mirror of
https://github.com/coredns/coredns.git
synced 2025-12-12 05:15:12 -05:00
Add configuration flag to set if RecursionDesired should be set on health checkers in Forward-plugin (#3679)
* Make the RD-flag in health-checks in the Forward-plugin configurable Introduces a new configuration flag; `health_check_non_recursive`. This flag makes the health-checker do non-recursive requests when checking the health of upstream servers. Signed-off-by: Geir Haugom <ghagit@haugom.org> Signed-off-by: Christian Tryti <ctryti@gmail.com> * Changes after feedback from reviewer * Better tests of health-checks with and without recursion * Removed the health_check_non_recursive configuration in favor of extending the existing health_check configuration. Now supports an optional `no_rec` argument. Signed-off-by: Christian Tryti <ctryti@gmail.com> * Add new test that checks setup of health_check. Signed-off-by: Christian Tryti <ctryti@gmail.com>
This commit is contained in:
@@ -52,7 +52,7 @@ type Forward struct {
|
||||
|
||||
// New returns a new Forward.
|
||||
func New() *Forward {
|
||||
f := &Forward{maxfails: 2, tlsConfig: new(tls.Config), expire: defaultExpire, p: new(policy.Random), from: ".", hcInterval: hcInterval}
|
||||
f := &Forward{maxfails: 2, tlsConfig: new(tls.Config), expire: defaultExpire, p: new(policy.Random), from: ".", hcInterval: hcInterval, opts: options{forceTCP: false, preferUDP: false, hcRecursionDesired: true}}
|
||||
return f
|
||||
}
|
||||
|
||||
@@ -224,8 +224,9 @@ var (
|
||||
|
||||
// options holds various options that can be set.
|
||||
type options struct {
|
||||
forceTCP bool
|
||||
preferUDP bool
|
||||
forceTCP bool
|
||||
preferUDP bool
|
||||
hcRecursionDesired bool
|
||||
}
|
||||
|
||||
const defaultTimeout = 5 * time.Second
|
||||
|
||||
Reference in New Issue
Block a user