diff --git a/plugin/dnstap/setup.go b/plugin/dnstap/setup.go index 2ab38d84c..ce12b5676 100644 --- a/plugin/dnstap/setup.go +++ b/plugin/dnstap/setup.go @@ -180,6 +180,8 @@ func parseConfig(c *caddy.Controller) ([]*Dnstap, error) { } d.ExtraFormat = c.Val() } + default: + return nil, c.Errf("unknown property '%s'", c.Val()) } } dnstaps = append(dnstaps, &d) diff --git a/plugin/dnstap/setup_test.go b/plugin/dnstap/setup_test.go index b66f0ee6a..71b173562 100644 --- a/plugin/dnstap/setup_test.go +++ b/plugin/dnstap/setup_test.go @@ -59,6 +59,7 @@ func TestConfig(t *testing.T) { {"dnstap dnstap.sock {\nidentity\n}\n", true, []results{{endpoint: "dnstap.sock", full: false, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1, multipleQueue: 1}}}, {"dnstap dnstap.sock {\nversion\n}\n", true, []results{{endpoint: "dnstap.sock", full: false, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1, multipleQueue: 1}}}, {"dnstap dnstap.sock {\nextra\n}\n", true, []results{{endpoint: "dnstap.sock", full: false, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1, multipleQueue: 1}}}, + {"dnstap dnstap.sock {\nidentitiy NAME\n}\n", true, []results{{endpoint: "dnstap.sock", full: false, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1, multipleQueue: 1}}}, // Limits and parsing for writebuffer (MiB) and queue (x10k) {"dnstap dnstap.sock full 1024 2048", false, []results{{endpoint: "dnstap.sock", full: true, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1024, multipleQueue: 2048}}}, {"dnstap dnstap.sock full 1025 1", true, []results{{endpoint: "dnstap.sock", full: true, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1, multipleQueue: 1}}}, diff --git a/plugin/trace/setup.go b/plugin/trace/setup.go index a6ecdfe85..c5fb04aa5 100644 --- a/plugin/trace/setup.go +++ b/plugin/trace/setup.go @@ -129,6 +129,8 @@ func traceParse(c *caddy.Controller) (*trace, error) { if err != nil { return nil, err } + default: + return nil, c.Errf("unknown property '%s'", c.Val()) } } } diff --git a/plugin/trace/setup_test.go b/plugin/trace/setup_test.go index 080a3d4e3..19f2d9acb 100644 --- a/plugin/trace/setup_test.go +++ b/plugin/trace/setup_test.go @@ -44,6 +44,7 @@ func TestTraceParse(t *testing.T) { {"trace {\n zipkin_max_backlog_size\n}", true, "", 1, `coredns`, false, 0, 0, 0}, {"trace {\n zipkin_max_batch_size\n}", true, "", 1, `coredns`, false, 0, 0, 0}, {"trace {\n zipkin_max_batch_interval\n}", true, "", 1, `coredns`, false, 0, 0, 0}, + {"trace {\n evrey 100\n}", true, "", 1, `coredns`, false, 0, 0, 0}, } for i, test := range tests { c := caddy.NewTestController("dns", test.input)