aboutsummaryrefslogtreecommitdiff
path: root/plugin/etcd (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-09-22K8s remove string ops (#2119)Gravatar Miek Gieben 2-2/+2
* plugin/kubernetes: remove bunch a string ops This removes a bunch of appends to where not needed, makes dnsutil.Join take variadic args which removes the need to wrap in a new string slice. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix calls to dnsutil.Join Signed-off-by: Miek Gieben <miek@miek.nl> * Revert these Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-29Default to scrubbing replies in the server (#2012)Gravatar Miek Gieben 3-5/+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-08-14Typo fixes (#2031)Gravatar Karsten Weiss 2-2/+2
2018-07-19Clean up tests logging (#1979)Gravatar Miek Gieben 1-0/+5
* Clean up tests logging This cleans up the travis logs so you can see the failures better. Older tests in tests/ would call log.SetOutput(ioutil.Discard) in a haphazard way. This add log.Discard and put an `init` function in each package's dir (no way to do this globally). The cleanup in tests/ is clear. All plugins also got this init function to have some uniformity and kill any (future) logging there in the tests as well. There is a one-off in pkg/healthcheck because that does log. Signed-off-by: Miek Gieben <miek@miek.nl> * bring back original log_test.go Signed-off-by: Miek Gieben <miek@miek.nl> * suppress logging here as well Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-19plugin/etcd: Add SRV and TXT examples. (#1980)Gravatar Jiacheng Xu 1-4/+34
2018-07-15Update etcd plugin documentation wrt etcdv3 support (#1974)Gravatar Nitish Tiwari 1-8/+16
Fixes #1960
2018-07-09Remove trailing whitespace (#1955)Gravatar Miek Gieben 1-1/+1
Prevent future; "remove trailing whitespace" PR, but adding a simple presubmit that checks for this. This presubmit flagged quite some offenders, remove all trailing whitespace from. Apart from that there aren't any other changes. Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-01Add nitisht to etcd OWNERS (#1919)Gravatar Miek Gieben 1-0/+2
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-01Document two lookups by CoreDNS etcdv3 plugin (#1918)Gravatar Nitish Tiwari 1-0/+7
2018-06-30plugin/etcdv3: Add etcd v3 plugin (#1702)Gravatar Nitish Tiwari 5-70/+64
* Update dependencies and add etcdv3 client * Update etcd plugin to support etcd v3 clients Fixes #341
2018-06-15plugin/forward: add REFUSED test (#1878)Gravatar Miek Gieben 1-1/+1
add a test to see if we copy the rcode correctly. Some minor cleanup in import ordering and renaming NewUpstream to New as we already are in the upstream package.
2018-06-11Remove dnsutil.Dedup (#1867)Gravatar Miek Gieben 2-34/+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-06-02presubmit: Check errorf as well (#1845)Gravatar Miek Gieben 5-5/+5
Uppercase all these test errors as well. And extend the presubmit to check for these in the future. Also do a slightly smarter grep to only get t.<something>. as (because dump regexp) this also grep over non test files.
2018-05-07presubmit: check for uppercase (#1774)Gravatar Miek Gieben 2-13/+13
Another thing we can test automatically, we sorta settled on using an uppercase letter in in t.Log and t.Fatal calls. Let's just check for this.
2018-05-01Do Compress only when need in request.Scrub (#1760)Gravatar Miek Gieben 2-2/+4
* 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-27Fix #1685 (#1700)Gravatar Mario Kleinsasser 2-1/+99
Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com> Create separate function for zone check Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com> Add tests for zone A records Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com> Remove pointer from checkZoneForRecord func signature, Add documentation Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com> Change apex to zone, Update readme information, Add additional tests Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com> Change zone to apex Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com> Change readme to reflect apex change Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com> Correct code comment Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com> Correct string join for apex.dns Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>
2018-04-22Use logging (#1718)Gravatar Miek Gieben 3-2/+3
* update docs * plugins: use plugin specific logging Hooking up pkg/log also changed NewWithPlugin to just take a string instead of a plugin.Handler as that is more flexible and for instance the Root "plugin" doesn't implement it fully. Same logging from the reload plugin: .:1043 2018/04/22 08:56:37 [INFO] CoreDNS-1.1.1 2018/04/22 08:56:37 [INFO] linux/amd64, go1.10.1, CoreDNS-1.1.1 linux/amd64, go1.10.1, 2018/04/22 08:56:37 [INFO] plugin/reload: Running configuration MD5 = ec4c9c55cd19759ea1c46b8c45742b06 2018/04/22 08:56:54 [INFO] Reloading 2018/04/22 08:56:54 [INFO] plugin/reload: Running configuration MD5 = 9e2bfdd85bdc9cceb740ba9c80f34c1a 2018/04/22 08:56:54 [INFO] Reloading complete * update docs * better doc
2018-04-22all: fix plugin import ordering (#1717)Gravatar Miek Gieben 6-12/+8
Got a bit messed up with stb lib "context" usage.
2018-04-20global: move to context (#1699)Gravatar Miek Gieben 6-6/+12
* 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-04-19Update all plugins to use plugin/pkg/log (#1694)Gravatar Miek Gieben 2-5/+5
* Update all plugins to use plugin/pkg/log I wish this could have been done with sed. Alas manually changed all callers to use the new plugin/pkg/log package. * Error -> Info * Add docs to debug plugin as well
2018-02-14plugin/kubernetes: Add upstream @self and loop count (#1484)Gravatar Chris O'Haver 5-12/+16
* 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/+7
* 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-08Add OWNERS file (#1486)Gravatar Miek Gieben 1-0/+4
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-06Fix default endpoint port (#1490)Gravatar Harshavardhana 1-1/+1
2018-01-30Don't use standard lib context package (#1468)Gravatar Miek Gieben 1-1/+1
With Go 1.9 you *can* include the std lib's context package and nothing breaks. However we never officially made the move (and grpc also doesn't ues the std lib's one). Standardize all plugins on using the extern context package. Fixes #1466
2018-01-24plugin/etcd: Remove unnecessary test cases (#1421)Gravatar Tobias Schmidt 1-10/+0
These test cases became invalid with the fix of message truncation and don't validate anything.
2018-01-24Fix truncation of messages longer than permitted by the client (#1417)Gravatar Tobias Schmidt 1-6/+2
* Fix truncation of messages longer than permitted by the client CoreDNS currently doesn't respect the maximum response size advertised by the client and returns the full answer on a message with the TC bit set. This breaks client implementations which rely on DNS servers respecting the advertised size limit, for example the Ruby stdlib client. It also has negative network performance implications, as large messages will be split up into multiple UDP packets, even though the client will discard the truncated response anyway. While RFC 2181 permits the response of partial RRSets, finding the correct number of records fitting into the advertised response size is non-trivial. As clients should ignore truncated messages, this change simply removes the full RRSet on truncated messages. * Remove incorrect etcd test assertion If a client requests a TXT record larger than its advertised buffer size, a DNS server should _not_ respond with the answer, but truncate the message and set the TC bit, so that the client can retry using TCP.
2018-01-10Doc (#1369)Gravatar Miek Gieben 1-1/+1
* Constent atx headers * Regen manual pages
2018-01-07Simplify plugin/pkg/fall (#1358)Gravatar John Belamaric 3-6/+2
* Simplify plugin/pkg/fall * Remove unused import * Fix fall_test * Get fall coverage to 100% just because * gofmt. sigh.
2018-01-07Add pkg/fall for Fallthrough (#1355)Gravatar Miek Gieben 5-12/+19
* 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-04Manual pages (#1346)Gravatar Miek Gieben 1-5/+18
* Add manual pages Generate manual pages from the README and extend README with Name and Description sections. The generation requires 'ronn' which may not be available. Just check in all generated manual pages.
2017-12-07Changing switch to compare on constants versus strings (#1285)Gravatar Brad Beam 1-10/+11
2017-12-05Update etcd/README.md for multiple endpoints, and add additional test cases ↵Gravatar Yong Tang 2-6/+27
(#1277) This fix tries to address the issue raised in 1275 to clarify the syntax for multiple endpoints specification. This fix also adds additional test cases to demo the usage. This fix fixes 1275. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-11-26plugin/etcd: drop inflight (#1249)Gravatar Miek Gieben 3-21/+5
Use caching, just ask etcd for every query. This also improves throughput because the single lock in inflght is bypassed.
2017-11-01plugin/{kubernetes/etcd}: dynamic SOA (#1188)Gravatar Miek Gieben 1-0/+17
Add a dynamic SOA record (at least the serial and minttl). This create another interface that should be implemented by the backends. For now default to returning epoch in as a uint32 (no change from before). Lower the minTTL returned to 30s (from 60s)
2017-10-24CIDR query routing (#1159)Gravatar Miek Gieben 1-3/+2
* core: allow all CIDR ranges in zone specifications Allow (e.g.) a v4 reverse on a /17. If a zone is specified in such a way a FilterFunc is set in the config. This filter is checked against incoming queries. For all other queries this adds a 'x != nil' check which will not impact performace too much. Benchmark function is added as well to check for this as wel. Add multiple tests in tests/server_reverse_test.go. Benchmark shows in the non-reverse case this hardly impact the speed: ~~~ classless: pkg: github.com/coredns/coredns/core/dnsserver BenchmarkCoreServeDNS-4 1000000 1431 ns/op 16 B/op 1 allocs/op pkg: github.com/coredns/coredns/core/dnsserver BenchmarkCoreServeDNS-4 1000000 1429 ns/op 16 B/op 1 allocs/op master: pkg: github.com/coredns/coredns/core/dnsserver BenchmarkCoreServeDNS-4 1000000 1412 ns/op 16 B/op 1 allocs/op pkg: github.com/coredns/coredns/core/dnsserver BenchmarkCoreServeDNS-4 1000000 1429 ns/op 16 B/op 1 allocs/op ~~~ * README.md updates
2017-10-10doc update (#1140)Gravatar Miek Gieben 1-6/+6
* doc update Go through all README and fix mistakes, extend example and let more corefile snippets be test for validity. * Cant use spefic addr in test
2017-09-21pkg: add dnstest (#1098)Gravatar Miek Gieben 6-12/+12
Add a full test server impl in this new package + tests. Move dnsrecorder into this package as well and finish up the commented out tests that were left in the old dnsrecorder package. Update all callers and tests.
2017-09-16More Middleware -> Plugin conversions (#1088)Gravatar Miek Gieben 6-7/+7
Forgot about these.
2017-09-15plugins: expand examples (#1077)Gravatar Miek Gieben 1-7/+7
* plugins: expand examples Expand some examples and test them by annotating it with `corefile` * Can't start kubernetes * Can test pprof :(
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 19-0/+1945
* 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