Commit graph

1208 commits

Author SHA1 Message Date
Miek Gieben
95342dfaad
plugin/kubernetes: make glog log to standard output (#1598)
Jump through all the hoops to make this work.
2018-03-09 19:55:43 +00:00
Miek Gieben
0353abd3f8
plugin/erratic: linkify RFC references (#1593)
Also add Also See Section.
2018-03-07 13:52:32 +00:00
Miek Gieben
804f745951
plugin/health: make reload work (#1585)
* plugin/health: make reload work

Remove the once.Do from the startup, so we can re-bind the HTTP
listener. Also clarify the usage of health in multiple server blocks
(this is not the best approach - but there isn't a generic solution at
this point).

Manual tested as we lack testing infra, i.e kill -SIGUSR1 and some
CURLing of the health endpoint.

* Readme test fix

* update

* dont need this
2018-03-02 21:40:14 -08:00
Miek Gieben
acf823cd78
Metrics2 (#1588)
* plugin/metrics: still need nil check for shutdown

the second prometheus statement will trigger: (on control-C)

[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x94f45a]

goroutine 25 [running]:
github.com/coredns/coredns/plugin/metrics.(*Metrics).OnShutdown(0xc420252000, 0x0, 0x0)
	/home/miek/g/src/github.com/coredns/coredns/plugin/metrics/metrics.go:107 +0x2a
github.com/coredns/coredns/plugin/metrics.(*Metrics).OnShutdown-fm(0x0, 0x0)
	/home/miek/g/src/github.com/coredns/coredns/plugin/metrics/setup.go:39 +0x2a
github.com/mholt/caddy.(*Instance).ShutdownCallbacks(0xc4202c81e0, 0x0, 0x0, 0x0)
	/home/miek/g/src/github.com/mholt/caddy/caddy.go:164 +0xb3
github.com/mholt/caddy.allShutdownCallbacks(0x1743935, 0x8, 0x14a1b40)
	/home/miek/g/src/github.com/mholt/caddy/sigtrap.go:95 +0x10d
github.com/mholt/caddy.executeShutdownCallbacks.func1()
	/home/miek/g/src/github.com/mholt/caddy/sigtrap.go:75 +0x8f
sync.(*Once).Do(0x2256b80, 0xc42036df88)
	/home/miek/upstream/go/src/sync/once.go:44 +0xbe
github.com/mholt/caddy.executeShutdownCallbacks(0x174033f, 0x6, 0x0)
	/home/miek/g/src/github.com/mholt/caddy/sigtrap.go:71 +0x73
github.com/mholt/caddy.trapSignalsCrossPlatform.func1.1()
	/home/miek/g/src/github.com/mholt/caddy/sigtrap.go:61 +0x36
created by github.com/mholt/caddy.trapSignalsCrossPlatform.func1
	/home/miek

* comments on why
2018-03-02 18:17:05 -08:00
Miek Gieben
6cec66ce40
plugin/reload: enable (#1587)
Couldn't revert the original commit, just manually perform the needed
tweaks.
2018-03-02 17:17:26 -08:00
Miek Gieben
6f3a7af548
Metrics reload (#1586)
* wip

* plugin/metrics: fix reload behavior

Fixes #1472
2018-03-02 17:16:25 -08:00
Uladzimir Trehubenka
5546dbf3c6 Added nanoseconds to dnstap plugin builder (#1583) 2018-03-02 04:50:31 -08:00
Miek Gieben
a131c22d24
plugin/health: doc updates (#1582)
Fixes #1564
2018-03-01 18:32:15 -08:00
Miek Gieben
32671bc983 plugin/auto: update some comments typos
Just happen to see these. Fix them.
2018-03-01 17:14:53 -08:00
Miek Gieben
d67396dc7b
plugin/deprecated: add an easy way to error on deprecated plugin (#1575)
* plugin/deprecated: add an easy way to error on depcated plugin

* lint

* better docs

* slightly more docs
2018-03-01 06:49:52 -08:00
Miek Gieben
654b88d8c4
just use setup (#1574)
All these functions are namespaced by their package anyway; just use
setup().
2018-02-28 19:56:14 -08:00
Miek Gieben
4f3dc207a4
plugin/file: shutdown reload goroutine (#1571)
* plugin/file: shutdown reload goroutine

Shutdown the z.Reload() routine (if started in the first place) on
shutdow and reload.

Fixes #1508

* Must be put in c.OnShutdown()

* up test coverage
2018-02-28 18:19:37 -08:00
varyoo
6bb08ffee4 Easier way to dnstap? (#1496)
* Easier way to dnstap?

* Remove unnecessary function parameter from Tapper

* golint

* golint 2

* Proxy dnstap tests

* README.md & doc

* net.IP

* Proxy test was incorrect

* Small changes

* Update README.md

* Was not reporting dnstap errors + test

* Wasn't working at all, now it's ok

* Thanks Travis
2018-02-28 18:19:01 -08:00
Miek Gieben
f697b33283
return an error for multiple use of some plugins (#1559)
* plugins: Return error for multiple use of some

Return plugin.ErrOnce when a plugin that doesn't support it, is called
mutliple times.

This now adds it for: cache, dnssec, errors, forward, hosts, nsid.
And changes it slightly in kubernetes, pprof, reload, root.

* more tests
2018-02-28 18:16:05 -08:00
Miek Gieben
5faa9e7bc1
plugin/log: log remote port addr as well (#1573)
Log the remote's port, for IPv6 addr this means we should enclose the v6
address in brackets; make this the default for 'remote'.
2018-02-28 18:15:12 -08:00
Miek Gieben
928de738dd
Rename reverse zone constants (#1568)
Rename the constants to IP4arpa and IP6arpa (shorter and exported) and
make IsReverse return the type of the reverse zone which could be handy
for some callers.

Also add tests for IsReverse()
2018-02-28 08:43:19 -08:00
Chris O'Haver
395b614349 plugin/kubernetes: PTR/A reverse query corner cases (#1551)
* better handle non PTR rev zone qrys

* vice versa

* tests

* comment typo

* much cleaner
2018-02-28 07:53:12 -08:00
Miek Gieben
455040c143
doc: some function/vars/const/package level updates (#1558)
* doc: some function/vars/const/package level updates

Various update that stood out while reading godoc.org for CoreDNS.

* Fix some misspellings as well
2018-02-23 15:02:05 +00:00
John Belamaric
e3b7beab6a
Fix health_checks which should be health_check (#1556) 2018-02-22 18:24:21 -05:00
Miek Gieben
11c7d519d1 Add - to name and description 2018-02-22 08:55:37 +00:00
Yong Tang
e9c878a0d9 Fix with gofmt -s -w for plugin/tls/tls_test.go (#1552)
to make goreportcard happy

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-22 07:25:55 +00:00
Chris O'Haver
aa2302e3f4 incl addtl rrs when computing cache ttl (#1549) 2018-02-21 21:02:49 +00:00
Freddy
86be6d2532 remove coredns-grpc reference and update DnsService link (#1542) 2018-02-19 15:29:20 +00:00
Miek Gieben
05e41c5969
go 1.10: update travis and gofmt (#1541)
* go 1.10: update travis and gofmt

fmt now complains about on file tls_test.go, fix that. Also remove
gofmt, as goimports also checks, so this was done twice.

Put go 1.9 and 1.10 in travis for the time being.

* goimports optional
2018-02-18 09:43:56 +01:00
Miek Gieben
8cce06cba1
Type.extra (#1538)
* Revert "pkg/typify: empty messages are OtherError (#1531)"

This reverts commit fc1d73ffa9.

* plugin/cache: add failsafeTTL

If we can not see what TTL we should put on a message to be cached, use
5 seconds as minimal TTL. We used to apply the maximum TTL to these
  messages.
2018-02-17 19:45:52 +01:00
Chris O'Haver
9719a47c1b plugin/kubernetes: Add noendpoints option (#1536)
* add noendpoints option

* go fmt
2018-02-16 11:05:52 -05:00
Chris O'Haver
2cad04ec10 plugin/template: add upstream option (#1529)
* add upstream

* docs

* tests
2018-02-16 09:45:25 +01:00
Chris O'Haver
ba573c0f40 plugin/auto/file/secondary: Use new upstream resolver (#1534)
* move file, auto, secondary to new upstream

* include context in request
2018-02-16 09:44:50 +01:00
Miek Gieben
fc1d73ffa9
pkg/typify: empty messages are OtherError (#1531)
Messages with nothing in them are considered OtherError, they can not
serve any purpose for normal clients (i.e. dyn update or notifies might
have a use for them).

Also update a test in the cache plugin, so that we explicitaly test for
this case.
2018-02-16 09:43:22 +01:00
Chris O'Haver
dfd72e440f plugin/kubernetes: add namespace watch (#1533)
* add namespace watch

* start ns watch, and add sync check
2018-02-15 14:21:54 -05:00
Miek Gieben
16504234e5
plugin/forward using pkg/up (#1493)
* plugin/forward: on demand healtchecking

Only start doing health checks when we encouner an error (any error).
This uses the new pluing/pkg/up package to abstract away the actual
checking. This reduces the LOC quite a bit; does need more testing, unit
testing and tcpdumping a bit.

* fix tests

* Fix readme

* Use pkg/up for healthchecks

* remove unused channel

* more cleanups

* update readme

* * Again do go generate and go build; still referencing the wrong forward
  repo? Anyway fixed.
* Use pkg/up for doing the healtchecks to cut back on unwanted queries
  * Change up.Func to return an error instead of a boolean.
  * Drop the string target argument as it doesn't make sense.
* Add healthcheck test on failing to get an upstream answer.

TODO(miek): double check Forward and Lookup and how they interact with
HC, and if we correctly call close() on those

* actual test

* Tests here

* more tests

* try getting rid of host

* Get rid of the host indirection

* Finish removing hosts

* moar testing

* import fmt

* field is not used

* docs

* move some stuff

* bring back health_check

* maxfails=0 test

* git and merging, bah

* review
2018-02-15 10:21:57 +01:00
Miek Gieben
8b035fa938
Fix imports (#1528) 2018-02-14 21:29:00 +01:00
Chris O'Haver
71ee323651 plugin/kubernetes: Add upstream @self and loop count (#1484)
* add upstream @self and loop count

* 1st round of feedback

* allow argless upstream

* update test

* readmes

* feedback
2018-02-14 21:11:26 +01:00
Francois Tur
ee8084a08f Plugin/Proxy - prevent nil pointer when query using a gRPC client that could not dial in (#1495)
* prevent nil pointer when query frpc client that could not open

* add UT checking we can now safely request DNS query on an invalid hostname, query for gRPC connection

* fix ortograph

* fix format

* fix package declaration, fix UT - grpclogger, use fatalf, build pool with known addresses

* type, useless error check - after review
2018-02-14 20:20:27 +01:00
Francois Tur
76455c6a0d Plugin/BIND - extend the syntax to allow multiple addresses (#1512)
* Extend bind to allow multiple addresses. UTs added. Changes the log for server starting, adding address when available

* update readme for bind

* fixes after review

* minor fix on readme

* accept multiple BIND directives in blocserver, consolidate the addresses

* fixes after review - format logging server address, variable names
2018-02-14 20:19:32 +01:00
Sandeep Rajan
a0834b1dd5 check DO bit is maintaining status (#1526) 2018-02-14 20:18:02 +01:00
Yong Tang
4e63d0be35 Enable goimports check, and fixes several imports format (#1525)
This fix enables goimports check and fixes several imports format
so that the import sections are prettier, e.g.:
```
 import (
-       "github.com/miekg/dns"
        "regexp"
        "strconv"
        "strings"
+
+       "github.com/miekg/dns"
 )
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-14 10:00:04 -05:00
Chris O'Haver
caf2553d7a fix ptr nxdomain response and test (#1524) 2018-02-13 10:52:56 -05:00
Chris O'Haver
ca5097ca13 reqd changes (#1522) 2018-02-12 14:27:16 -05:00
John Belamaric
bd156dc9d1 Stop noisy modifications (#1517)
* Stop noisy modifications

* Review comments, tests

* More coverage

* vet

* Make it obvious new port name is not a typo
2018-02-09 22:32:52 +00:00
Chris O'Haver
d2bbe0103d kubernetes: Fix Federation example in README (#1515)
Remove `fallthrough` from the federation example in the README.  `fallthrough` isn't needed here and has no effect (federation has an implicit fallthrough for non-federated queries).  
It's inclusion is confusing.
2018-02-09 15:40:50 -05:00
Miek Gieben
2e894eb0a2
plugin/reload: disable for now (#1511)
Reloading should work (kill -TERM reload the coredns process), but a lot
of plugins can't handle it proper. Disable to reload plugin until we fix
(most) of the plugins
2018-02-09 11:30:55 +00:00
Miek Gieben
006ce4d56e
Add Chris back (#1513)
Pinged me, still interested in helping out \o/
2018-02-09 10:48:07 +00:00
Yong Tang
89b6e0bedd Add a test case for case insensitive/preserving with whoami plugin (#1509)
This fix add a test case for case insensitive/preserving with
whoami plugin.

This fix is part of the effort for 1403.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-08 20:08:03 +00:00
Sandeep Rajan
d0892abc2c add sync for proper termination (#1507) 2018-02-08 13:57:49 -05:00
Brad Beam
6fd954f19c support for zone transfer for kubernetes (#1259)
* plugin/kubernetes: axfr

Hook up dynamic SOA serial by setting ResourceEventHandlerFuncs in
dnsController.

Add prototype of returns msg.Services via the Transfer function. Leave
expanding this to RRs out of scope for a bit.

* plugin/kubernetes: axfr

Respond to AXFR queries

* Fixing race condition

* Fixing instantiation of dnstest writer

* Updates from review
2018-02-08 16:11:04 +00:00
Miek Gieben
fd7abd9849
Add OWNERS file (#1486)
This should have everyone, but the process was quite manual. The rename
from middleware -> plugin also meant I had to do some extra digging on
who actually submitted the PR. I also double checked the current list of
people with commit access.

Every plugin now has an OWNERS, except *reverse*. I'll file a bug for
that.
2018-02-08 10:55:51 +00:00
Sandeep Rajan
a4e0f6452d plugin/rewrite: remove do set in edns0 (#1500)
* remove setdo

* gofmt
2018-02-07 13:53:23 -05:00
Chris O'Haver
82854bf098 plugin/kubernetes: Allow only one k8s section (#1497)
* allow only one k8s section

* add test
2018-02-07 16:31:08 +00:00
Paul Greenberg
f636930c5c plugin/rewrite: rewrite responses for all record types (#1460) (#1463) 2018-02-06 18:40:46 +00:00