aboutsummaryrefslogtreecommitdiff
path: root/plugin (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-06-09Publish metadata from kubernetes plugin (#2829)Gravatar John Belamaric 6-6/+218
* Publish metadata from kubernetes plugin * stickler fix * Add a couple tests * Add metadata section to README * Update plugin/kubernetes/README.md Co-Authored-By: Chris O'Haver <cohaver@infoblox.com> * Address nit
2019-06-09plugin/ready: fix starts and restarts (#2814)Gravatar Miek Gieben 4-23/+20
Add OnRestartFailed to the ready plugin and some various cleanups. Document slightly better how things are supposed to work with multiple `ready`'s in the multiple Server Blocks. All manually tested with this Corefile: ~~~ . { log ready } example.org { log chaos ready } ~~~ And then `kill -SIGUSR1` and curling the ready endpoint. This works well, the FailedReload is triggered by adding a syntax error in the Corefile. See #2659 Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-09remove unused functions (#2873)Gravatar Chris O'Haver 2-97/+0
2019-06-07Revert "be sure to close connection after completion of xfr out. (#2866)" ↵Gravatar Miek Gieben 1-4/+2
(#2872) This reverts commit a657e1f6618ee94c46fa9374dd29c21345710d38.
2019-06-05be sure to close connection after completion of xfr out. (#2866)Gravatar JINMEI Tatuya 1-2/+4
otherwise the connection and associated socket stay in the CLOSE_WAIT state unless/until golang runtime performs GC.
2019-06-03stepdown from CoreDNS maintainer (#2861)Gravatar Francois Tur 4-8/+0
2019-06-01allow an empty response (#2855)Gravatar Chris O'Haver 2-11/+7
2019-06-01plugin/kubernetes: skip deleting pods (#2853)Gravatar Miek Gieben 4-9/+6
Don't add pods to our internal cache that are being deleted. This saves a field in the struct as well. Add (extra) comments about adding fields to the object/{Pod,Service,Endpoint} structs. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-31Update README.md (#2856)Gravatar Cricket Liu 1-48/+48
General syntactic cleanup.
2019-05-31make sure client CA and auth type are set if CA is explicitly specified. (#2825)Gravatar JINMEI Tatuya 6-1/+160
* make sure client CA and auth type are set if CA is explicitly specified. added some simple tests to confirm the effect. * test certificates (forgot to add them in the previous commit) * made client auth policy configurable with new client_auth option. README has been updated accordingly. * fix editorial in README
2019-05-31kubernetes: bump to client-go 11.0.0 (#2854)Gravatar Chris O'Haver 2-4/+10
* client-go 11.0.0 * Core moved to CoreV1
2019-05-29Fix for #2842, instead of returning the first Pod, return the one whi… (#2846)Gravatar Andras Spitzer 2-0/+8
* Fix for #2842, instead of returning the first Pod, return the one which is Running * a more memory efficient version of the fix, string -> bool * fix with no extra fields in struct, return nil at Pod conversion if Pod is not Running * let Kuberneretes filter for Running Pods using FieldSelector * filter for Pods that are Running and Pending (implicit)
2019-05-23pkg/log: fix data race on d (#2698)Gravatar Miek Gieben 5-25/+46
* pkg/log: fix data race on d Wrap d in a mutex to prevent data race. This makes is slower, but this is a debugging aid anyway. It's not used normally. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests compilation Signed-off-by: Miek Gieben <miek@miek.nl> * Fix test compile Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-18plugin/metrcs: fix datarace on listeners (#2835)Gravatar Miek Gieben 6-30/+62
This fixes a data race on the listener(s) that get started in the metrics plugins. It also restore pkg/uniq to its former glory and removes and state being carried in there; this means for metrics that registry.go was to replicate that behavior *with* locking (as pkg/uniq doesn't do, or need that). Also renamed uniqAddr to just u, to make it slightly shorter. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-18pkg/log: reset the buffer in the tests (#2828)Gravatar Miek Gieben 1-0/+4
Reset the buf otherwise we're not checking the new value. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-13plugin/metrics: fix failed reload (#2816)Gravatar Miek Gieben 3-30/+25
Fix metrics endpoint on a failed reload, follows the same lines as the previous PRs, see for e.g. 076b8d4f. Test with a Corefile with 2 server blocks and metrics enabled and then introducing a syntax error: ~~~ [ERROR] Restart failed: Corefile:5 - Error during parsing: Unknown directive 'jfkdjk' [ERROR] SIGUSR1: starting with listener file descriptors: Corefile:5 - Error during parsing: Unknown directive 'jfkdjk' ~~~ And then curl-ing the metrics endpoint. See #2659 and as this is the last one. Fixes: #2659 Getting this all right turns out to be tricky, also it's not easy testable which is something I should fix. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-07make ignore empty work with ext svc types (#2823)Gravatar Chris O'Haver 2-1/+11
2019-05-05Rename middleware -> plugin in comment (#2818)Gravatar Yong Tang 1-1/+1
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-05-05plugin/autopath docs: remove last use of middleware (#2817)Gravatar Miek Gieben 1-1/+1
This has somehow survived; the docs still used Middleware instead of Plugins. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-04plugin/health: add OnRestartFailed (#2812)Gravatar Miek Gieben 3-10/+3
Add OnReStartFailed which makes the health plugin stay up if the Corefile is corrupt and we revert to the previous version. Also needs a fix for the channel handling See #2659 Testing it will log the following when restarting with a corrupted Corefile ~~~ 2019-05-04T18:01:59.431Z [INFO] linux/amd64, go1.12.4, CoreDNS-1.5.0 linux/amd64, go1.12.4, [INFO] SIGUSR1: Reloading [INFO] Reloading [ERROR] Restart failed: Corefile:5 - Error during parsing: Unknown directive 'bdhfhdhj' [ERROR] SIGUSR1: starting with listener file descriptors: Corefile:5 - Error during parsing: Unknown directive 'bdhfhdhj' ~~~ After which the curl still works. This also needed a change to reset the channel used for the metrics go-routine which gets closed on shutdown, otherwise you'll see: ~~~ ^C[INFO] SIGINT: Shutting down panic: close of closed channel goroutine 90 [running]: github.com/coredns/coredns/plugin/health.(*health).OnFinalShutdown(0xc000089bc0, 0xc000063d88, 0x4afe6d) ~~~ Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-04plugin/health: cleanups (#2811)Gravatar Miek Gieben 6-28/+14
Small, trivial cleanup: got triggered because I saw a comment on how health plugins polls other plugins which isn't true. * Remove useless newHealth function * healthParse -> parse * Remove useless constants Net deletion of code. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-01kubernetes: never respond with NXDOMAIN for authority label (#2769)Gravatar Billie Cleek 2-3/+66
* kubernetes: never respond with NXDOMAIN for authority label Return a nodata response when trying to resolve the authority's label for a record type that doesn't match the record type of the authority. This guards against poisoning the authority record by requesting the wrong record type for the authority label. For instance, given an authoritative resolver that uses subdomain delegation for Kubernetes services of a cluster that's configured to use IPv4, the parent may be poisoned by querying it for the authority label of the cluster subdomain with a AAAA record type, which would otherwise (i.e. without this change) return an NXDOMAIN. That is, given cluster.example.com NS 10800 ns.dns.cluster.example.com ns.dns.cluster.example.com A 10800 10.0.1.2 The parent may be poisoned for the SOA TTL by querying it for a AAAA record of ns.dns.cluster.example.com, causing the parent to fail delegate properly until the SOA TTL lapses. * kubernetes: add tests for authority queries
2019-04-30Update README.md (#2808)Gravatar Cricket Liu 1-9/+9
Minor grammatical fixes.
2019-04-30plugin/loop: Update troubleshooting step (#2804)Gravatar Chris O'Haver 1-1/+1
* Update README.md
2019-04-29Remove trailing whitespaces (#2806)Gravatar Yong Tang 2-3/+3
While running make notices the following: ``` ** presubmit/trailing-whitespace plugin/grpc/README.md:Multiple upstreams are randomized (see `policy`) on first use. When a proxy returns an error plugin/pprof/setup_test.go: {`pprof :1234 { plugin/pprof/setup_test.go: {`pprof { ** presubmit/trailing-whitespace: please remove any trailing white space ``` This fix removes the whitespaces Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-04-28Add any plugin (#2801)Gravatar Miek Gieben 5-0/+126
* Add any plugin This adds the any plugin, a plain copy of coredns/any documented here https://coredns.io/explugins/any/ as an external plugin. Fixes: #2785 Signed-off-by: Miek Gieben <miek@miek.nl> * Stickler bot nit Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-24Update README.md (#2799)Gravatar Cricket Liu 1-1/+1
s/from/form
2019-04-23plugin/chaos: randomize author list (#2794)Gravatar Miek Gieben 1-2/+6
Randomize the author list on request; keep the zowners.go file stable so a 'go generate' remain stable. chaos.Owners could potentially be a map and be randomized by ranging over it, but this seems simpler and fewer lines of code. Bit of Easter hacking; seems more fair to randomize this list. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-18plugin/health: clarify use a bit (#2791)Gravatar Miek Gieben 1-4/+6
Make clearer how health works and that is it process wide. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-08plugins: remove `upstream [ADDRESS]` from docs (#2772)Gravatar Miek Gieben 4-26/+13
Various plugins still had this documented, the setup functions still allow it (which is fine), but update the docs that this arguments isn't there any more. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-08[plugin/cache] cache failures (#2720)Gravatar Kun Chang 3-8/+46
* cache failures * use ServerError
2019-04-08Run gofmt -w -s on codebase (#2773)Gravatar Miek Gieben 6-61/+61
This formats and simplifies all code by running gofmt -w -s on all Go files. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-06Doc tweaks (#2763)Gravatar Miek Gieben 1-2/+2
* fix date on 150 release notes * fix syntax in route53 plugin Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-04plugin/forward: remove proxy comparison (#2760)Gravatar Miek Gieben 1-4/+0
*proxy* is removed, so this is moot Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-02plugin/kubernetes: Disable resync by default (#2752)Gravatar John Belamaric 2-2/+3
* Disable resync by default * Document default resync
2019-04-02Add all policies to forward plugin docs (#2751)Gravatar Fernando Ripoll 1-0/+3
2019-04-01Bump the resync period to five hours (#2748)Gravatar John Belamaric 1-1/+1
2019-04-01Update README.md (#2747)Gravatar Chris O'Haver 1-1/+3
2019-04-01Fully deprecate TIMEOUT and NO_RELOAD (#2742)Gravatar Xiao An 7-97/+63
* Fully deprecate NO_RELOAD Signed-off-by: Xiao An <hac@zju.edu.cn> * Fully deprecate TIMEOUT Signed-off-by: Xiao An <hac@zju.edu.cn> * Update CI tests to adapt to the deprecation of TIMEOUT Signed-off-by: Xiao An <hac@zju.edu.cn> * Add documents for directive transfer in plugin auto Signed-off-by: Xiao An <hac@zju.edu.cn>
2019-03-31plugin/chaos: add default list of authors (#2737)Gravatar Miek Gieben 6-28/+43
* plugin/chaos: add default list of authors Add a owners_generate.go that generates a Owners variables for use in the chaos plugin. Add a default list of authors in the authors.bind CH zone. When doing a query this now returns: ~~~ sh % dig authors.bind TXT CH ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5456 ;; flags: qr rd; QUERY: 1, ANSWER: 22, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;authors.bind. CH TXT ;; ANSWER SECTION: authors.bind. 0 CH TXT "bradbeam" authors.bind. 0 CH TXT "chrisohaver" authors.bind. 0 CH TXT "dilyevsky" authors.bind. 0 CH TXT "ekleiner" authors.bind. 0 CH TXT "fastest963" authors.bind. 0 CH TXT "fturib" authors.bind. 0 CH TXT "greenpau" authors.bind. 0 CH TXT "grobie" authors.bind. 0 CH TXT "inigohu" authors.bind. 0 CH TXT "isolus" authors.bind. 0 CH TXT "johnbelamaric" authors.bind. 0 CH TXT "miekg" authors.bind. 0 CH TXT "nchrisdk" authors.bind. 0 CH TXT "nitisht" authors.bind. 0 CH TXT "pmoroney" authors.bind. 0 CH TXT "rajansandeep" authors.bind. 0 CH TXT "rdrozhdzh" authors.bind. 0 CH TXT "rtreffer" authors.bind. 0 CH TXT "stp-ip" authors.bind. 0 CH TXT "superq" authors.bind. 0 CH TXT "varyoo" authors.bind. 0 CH TXT "yongtang" ~~~ This was hard to do previously as we didn't hardcode this in the source, but now with OWNERS files we can just generate this list. Privacy wise this isn't worse than being listed in OWNERS file in the first place. And it's a nice hat tip to the people making CoreDNS better. Signed-off-by: Miek Gieben <miek@miek.nl> * Sticklet bot comments Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-31[plugin/route53]: Do not return NXDOMAIN where it should be NODATA. (#2734)Gravatar dilyevsky 2-45/+62
* [plugin/route53]: Do not return NXDOMAIN where it should be NODATA. Signed-off-by: Dmitry Ilyevskiy <dmitry.ilyevskiy@getcruise.com> * Fix bad merge. Signed-off-by: Dmitry Ilyevskiy <dmitry.ilyevskiy@getcruise.com>
2019-03-29plugin/cancel: add context cancelation plugin (#2711)Gravatar Miek Gieben 6-0/+215
* plugin/cancel: add context cancelation plugin Per review comments on #2704, move this into a plugin that gets called. Add the most minimal plugin, tests and documenation. Signed-off-by: Miek Gieben <miek@miek.nl> * plugin/cache: add timeout option review feedback: add option to set custom timeout. Signed-off-by: Miek Gieben <miek@miek.nl> * spelling Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-29plugin/pprof: spice up the readme (#2731)Gravatar Miek Gieben 1-7/+17
Rework this a little to be more inline with the other READMEs Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-29plugin/pprof - add option to enable block profiling (#2729)Gravatar Francois Tur 4-11/+53
* - add an option for block profiling to plugin pprof * - move option block into nested block
2019-03-26restore change detection (#2696)Gravatar Chris O'Haver 2-3/+183
2019-03-26Remove context.Context from request.Request (#2726)Gravatar Miek Gieben 19-114/+117
* Remove context.Context from request.Request This removes the context from request.Request and makes all the changes in the code to make it compile again. It's all mechanical. It did unearth some weirdness in that the context was kept in handler structs which may cause havoc with concurrently handling of requests. Fixes #2721 Signed-off-by: Miek Gieben <miek@miek.nl> * Make test compile Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-26pkg/response: add extra test for impossible msg (#2727)Gravatar Miek Gieben 1-6/+13
Add another test case for impossible DNS messages which should not be cached. This adds a check for a message that denies its own existence. Fixes #2724. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-25Don't double report metrics on error (#2719)Gravatar Miek Gieben 1-1/+3
* Don't double report metrics on error When there is an error use a different function to report the metrics, in case the plugin chain handled the request the metrics are already reported. Fixes: #2717 Signed-off-by: Miek Gieben <miek@miek.nl> * Compile again Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-25Remove server addr from the context (#2722)Gravatar Miek Gieben 5-22/+11
* more Signed-off-by: Miek Gieben <miek@miek.nl> * Remove server addr from the context This was added twice, just leave the server which also holds the address. Conflicts with #2719 but should be easy to fix. Signed-off-by: Miek Gieben <miek@miek.nl> * doesn't need server context Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-25plugin/log: remove ErrorFunc (#2716)Gravatar Miek Gieben 3-24/+5
The server handles this case no need to also do it in the log plugin. Means DefaultErrorFunc can be private to the dnsserver and is now renamed to just errorFunc Fixes: #2715 Signed-off-by: Miek Gieben <miek@miek.nl>