aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/handler.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-05-04plugin/kubernetes: fix SOA response for non-apex queries (#4592)Gravatar Chris O'Haver 1-2/+3
* fix SOA response for non-apex queries Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * handle mixed case Signed-off-by: Chris O'Haver <cohaver@infoblox.com> * do full string compare Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-03-09transfer: reply with refused (#4510)Gravatar Miek Gieben 1-0/+2
* transfer: reply with refused When the *transfer* plugin is not loaded and of the handlers will still see the AXFR/IXFR request because it is not intercepted. They need to reply with REFUSED in that case. Update file, auto and k8s to do this. Add testcase in the file plugin. Ideally *erratic* should be moved over as well, but maybe that's *erratic* This is a bug fix. Signed-off-by: Miek Gieben <miek@miek.nl> * import path Signed-off-by: Miek Gieben <miek@miek.nl>
2020-09-24Cherry-pick: Implement notifies for transfer plugin (#3972) (#4142)Gravatar Yong Tang 1-2/+0
* Implement notifies for transfer plugin (#3972) * Fix notifies in transfer plugin Signed-off-by: Miek Gieben <miek@miek.nl> * Make it compile Signed-off-by: Miek Gieben <miek@miek.nl> * Port more plugins Signed-off-by: Miek Gieben <miek@miek.nl> * golint Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * Fix notifies in transfer plugin Signed-off-by: Miek Gieben <miek@miek.nl> * Make it compile Signed-off-by: Miek Gieben <miek@miek.nl> * Port more plugins Signed-off-by: Miek Gieben <miek@miek.nl> * golint Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * really fix test Signed-off-by: Miek Gieben <miek@miek.nl> * Implement ixfr fallback and unify file and auto for transfering Signed-off-by: Miek Gieben <miek@miek.nl> * Add transfer tests copied and modified from #3452 Signed-off-by: Miek Gieben <miek@miek.nl> * Test correct selection of plugin Signed-off-by: Miek Gieben <miek@miek.nl> * add upstream back in Signed-off-by: Miek Gieben <miek@miek.nl> * Implement ixfr fallback and unify file and auto for transfering Signed-off-by: Miek Gieben <miek@miek.nl> * fix test Signed-off-by: Miek Gieben <miek@miek.nl> * properly merge Signed-off-by: Miek Gieben <miek@miek.nl> * Remove plugin/kubernetes/setup_transfer_test.go Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Co-authored-by: Miek Gieben <miek@miek.nl>
2020-07-08Revert "Implement notifies for transfer plugin (#3972)" (#3995)Gravatar Yong Tang 1-0/+2
This reverts commit 68f1dd5ddf0451cc3a1b24a72c2965b8d896ffba. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2020-07-07Implement notifies for transfer plugin (#3972)Gravatar Miek Gieben 1-2/+0
* Fix notifies in transfer plugin Signed-off-by: Miek Gieben <miek@miek.nl> * Make it compile Signed-off-by: Miek Gieben <miek@miek.nl> * Port more plugins Signed-off-by: Miek Gieben <miek@miek.nl> * golint Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * Fix notifies in transfer plugin Signed-off-by: Miek Gieben <miek@miek.nl> * Make it compile Signed-off-by: Miek Gieben <miek@miek.nl> * Port more plugins Signed-off-by: Miek Gieben <miek@miek.nl> * golint Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl> * really fix test Signed-off-by: Miek Gieben <miek@miek.nl> * Implement ixfr fallback and unify file and auto for transfering Signed-off-by: Miek Gieben <miek@miek.nl> * Add transfer tests copied and modified from #3452 Signed-off-by: Miek Gieben <miek@miek.nl> * Test correct selection of plugin Signed-off-by: Miek Gieben <miek@miek.nl> * add upstream back in Signed-off-by: Miek Gieben <miek@miek.nl> * Implement ixfr fallback and unify file and auto for transfering Signed-off-by: Miek Gieben <miek@miek.nl> * fix test Signed-off-by: Miek Gieben <miek@miek.nl> * properly merge Signed-off-by: Miek Gieben <miek@miek.nl>
2020-01-03Resolve TXT records via CNAME (#3557)Gravatar Jonathan Nagy 1-1/+1
* Add test case for TXT lookup via CNAME Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com> * Return HostType of explicit TXT records Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com> * Adapt TXT method lookup to allow lookup via CNAME Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com> * Implement lookup of TXT records via CNAME Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com>
2019-08-12fix NXDOMAIN/NODATA fallthough case (#3118)Gravatar Chris O'Haver 1-1/+3
2019-08-09plugin/kubernetes: Don't do a zone transfer for NS requests (#3098)Gravatar Chris O'Haver 1-2/+2
* fix switch order * remove fallthough * add test * fix test * distingush nxdomain/nodata for at least first subdomain of zone * restore fallthough; reorder switch cases
2019-03-26Remove context.Context from request.Request (#2726)Gravatar Miek Gieben 1-14/+14
* 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-02-24plugin/kubernetes: create dns.Msg later (#2604)Gravatar Miek Gieben 1-18/+16
There is no need to do this at the top of the handler, move this down into the function. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-08plugin/kubernetes: fix case preservation and add test (#2430)Gravatar Chris O'Haver 1-2/+3
* fix case preservation and add test * only fix case in k8s
2018-12-30disable ra flag for several plugins (#2408)Gravatar Isolus 1-1/+1
* disable ra flag for several plugins * removed unnecessary assignment * removed more unnecessary assignments
2018-10-22Unblock startup if kubernetes API is unavailable (#2126)Gravatar Kevin Nisbet 1-0/+4
2018-08-29Default to scrubbing replies in the server (#2012)Gravatar Miek Gieben 1-2/+0
Every plugin needs to deal with EDNS0 and should call Scrub to make a message fit the client's buffer. Move this functionality into the server and wrapping the ResponseWriter into a ScrubWriter that handles these bits for us. Result: Less code and faster, because multiple chained plugins could all be calling scrub and SizeAndDo - now there is just one place. Most tests in file/* and dnssec/* needed adjusting because in those unit tests you don't see OPT RRs anymore. The DNSSEC signer was also looking at the returned OPT RR to see if it needed to sign - as those are now added by the server (and thus later), this needed to change slightly. Scrub itself still exist (for backward compat reasons), but has been made a noop. Scrub has been renamed to scrub as it should not be used by external plugins. Fixes: #2010 Signed-off-by: Miek Gieben <miek@miek.nl>
2018-06-11Remove dnsutil.Dedup (#1867)Gravatar Miek Gieben 1-4/+0
Remove the code and remove the call in etcd and kubernetes handlers. This does mean we should not add dups in the first place, which means adding maps in backend_lookup to prevent dups from begin added. This should cut down on the allocations because dnsutil.Dedup is very expensive by converting everything to strings, we avoid doing that now.
2018-05-01Do Compress only when need in request.Scrub (#1760)Gravatar Miek Gieben 1-1/+2
* Remove Compress by default Set Compress = true in Scrub only when the message doesn not fit the advertized buffer. Doing compression is expensive, so try to avoid it. Master vs this branch pkg: github.com/coredns/coredns/plugin/cache BenchmarkCacheResponse-2 50000 24774 ns/op pkg: github.com/coredns/coredns/plugin/cache BenchmarkCacheResponse-2 100000 21960 ns/op * and make it compile
2018-04-22all: fix plugin import ordering (#1717)Gravatar Miek Gieben 1-2/+2
Got a bit messed up with stb lib "context" usage.
2018-04-20global: move to context (#1699)Gravatar Miek Gieben 1-1/+2
* global: move to context Move from golang.org/x/net/context to std lib's context. Change done with: for i in $(grep -l '/context' **/*.go); do sed -e 's|golang.org/x/net/context|context|' -i $i; echo $i; done for i in **/*.go; do goimports -w $i; done * drop from dns.pb.go as well
2018-02-14plugin/kubernetes: Add upstream @self and loop count (#1484)Gravatar Chris O'Haver 1-13/+14
* add upstream @self and loop count * 1st round of feedback * allow argless upstream * update test * readmes * feedback
2018-02-08support for zone transfer for kubernetes (#1259)Gravatar Brad Beam 1-0/+3
* 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-01-07Add pkg/fall for Fallthrough (#1355)Gravatar Miek Gieben 1-1/+1
* Add pkg/fall for Fallthrough Move this into it's own package to facilitate tests. Important bug was fixed: make the names fully qualified. Add fall package to hosts, reverse, etcd, and fix kubernetes and any tests. The k8s tests are still as-is, might need a future cleanup.
2018-01-06kubernetes: Add zone filtering to fallthrough (#1353)Gravatar John Belamaric 1-1/+1
* Add zone filtering to fallthrough * Doh. gofmt * Update documentation
2017-12-07Changing switch to compare on constants versus strings (#1285)Gravatar Brad Beam 1-10/+10
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 1-0/+86
* Rename middleware to plugin first pass; mostly used 'sed', few spots where I manually changed text. This still builds a coredns binary. * fmt error * Rename AddMiddleware to AddPlugin * Readd AddMiddleware to remain backwards compat