aboutsummaryrefslogtreecommitdiff
path: root/plugin/hosts/hostsfile_test.go
diff options
context:
space:
mode:
authorGravatar Thomas Mangin <thomas@mangin.com> 2019-02-12 16:09:33 +0000
committerGravatar Pat Moroney <pat@pat.email> 2019-02-12 09:09:33 -0700
commit4b402e000d22a18b333e5b136e43de634f131a99 (patch)
treeafaa2f76ede63d58280842b83633034ce2cc50e0 /plugin/hosts/hostsfile_test.go
parente47d881461a947dbcc1d285d8a8d9f6a79e77fd7 (diff)
downloadcoredns-4b402e000d22a18b333e5b136e43de634f131a99.tar.gz
coredns-4b402e000d22a18b333e5b136e43de634f131a99.tar.zst
coredns-4b402e000d22a18b333e5b136e43de634f131a99.zip
plugin/hosts provide more configuration flexibility (#2535)
* plugin/hosts provide more configuration flexibility This patch adds few features to the host plugin * no-reverse (both as first argument on the plugin line and inline) disable the automatic generation of reserve entries for hosts * ttl <duration> (inline only atm) allows to change the default ttl (default 5 minutes) * reload <duration> (inline only atm) allows to change the reloading interval (default 5s) * plugin/hosts remove superfluous parameters to parse
Diffstat (limited to 'plugin/hosts/hostsfile_test.go')
-rw-r--r--plugin/hosts/hostsfile_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugin/hosts/hostsfile_test.go b/plugin/hosts/hostsfile_test.go
index 26a2916f0..db0e63d75 100644
--- a/plugin/hosts/hostsfile_test.go
+++ b/plugin/hosts/hostsfile_test.go
@@ -12,7 +12,11 @@ import (
)
func testHostsfile(file string) *Hostsfile {
- h := &Hostsfile{Origins: []string{"."}}
+ h := &Hostsfile{
+ Origins: []string{"."},
+ hmap: newHostsMap(),
+ options: newOptions(),
+ }
h.parseReader(strings.NewReader(file))
return h
}