From 18304ce9b75a401ed510d270c013dc4fe6480420 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 4 Jul 2019 06:56:37 +0100 Subject: plugin/file: make non-existent file non-fatal (#2955) * plugin/file: make non-existent file non-fatal If the zone file being loaded doesn't exist *and* reload is enabled, just wait the file to pop up in the normal Reload routine. If reload is set to 0s; we keep this a fatal error on startup. Aslo fix the ticker in z.Reload(): remove the per second ticks and just use the reload interval for the ticker. Brush up the documentation a bit as well. Fixes: #2951 Signed-off-by: Miek Gieben * Stickler and test compile Signed-off-by: Miek Gieben * Remove there too Signed-off-by: Miek Gieben * Cant README test these because zone files dont exist Signed-off-by: Miek Gieben --- test/file_reload_test.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'test/file_reload_test.go') diff --git a/test/file_reload_test.go b/test/file_reload_test.go index 91372ecc3..e61003b8b 100644 --- a/test/file_reload_test.go +++ b/test/file_reload_test.go @@ -5,15 +5,12 @@ import ( "testing" "time" - "github.com/coredns/coredns/plugin/file" "github.com/coredns/coredns/plugin/test" "github.com/miekg/dns" ) func TestZoneReload(t *testing.T) { - file.TickTime = 1 * time.Second - name, rm, err := test.TempFile(".", exampleOrg) if err != nil { t.Fatalf("Failed to create zone: %s", err) -- cgit v1.2.3