aboutsummaryrefslogtreecommitdiff
path: root/plugin (follow)
AgeCommit message (Collapse)AuthorFilesLines
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-02-23refactor tests to remove duplicate code (#2602)Gravatar Darshan Chaudhary 1-80/+38
Signed-off-by: darshanime <deathbullet@gmail.com>
2019-02-22Fix some typos in comment (#2599)Gravatar JoeWrightss 1-2/+2
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-21Trivial fix typo (#2590)Gravatar Nguyen Hai Truong 1-1/+1
Although it is spelling mistakes, it might make an affects while reading. Signed-off-by: Nguyen Hai Truong <truongnh@vn.fujitsu.com>
2019-02-21Replacing 'HTTP' by 'HTTPS' for securing links (#2591)Gravatar LongKB 1-1/+1
Currently, there are some links that we access with **HTTP**, it is redirected to **HTTPS** automatically. So this commit aims to replace **http://...** by **https://...** for security. Co-Authored-By: Nguyen Phuong An <AnNP@vn.fujitsu.com> Signed-off-by: Kim Bao Long <longkb@vn.fujitsu.com>
2019-02-21Fix some typos in documents (#2592)Gravatar Xiao An 3-5/+5
Signed-off-by: Xiao An <hac@zju.edu.cn>
2019-02-21Fix typo: rrflags -> rflags (#2587)Gravatar Miek Gieben 2-3/+3
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-20Fix typos (#2584)Gravatar Guillaume Gelin 1-2/+2
2019-02-20Remove redundant words in comments (#2589)Gravatar Nguyen Hai Truong 2-2/+2
Although it is spelling mistakes, it might make an affects while reading. Signed-off-by: Nguyen Hai Truong <truongnh@vn.fujitsu.com>
2019-02-20Remove some duplicate worlds (#2582)Gravatar Nguyen Phuong An 7-7/+7
Signed-off-by: Nguyen Phuong An <AnNP@vn.fujitsu.com>
2019-02-18plugin/forward: fixed debug dump output on FORMERR (#2576)Gravatar Uladzimir Trehubenka 1-1/+1
2019-02-17plugin/hosts: fix data race on h.size (#2573)Gravatar Miek Gieben 1-1/+4
Guard the access of h.size as this is now a data race. Fixes #2571 Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-17plugin/reload: fix data races (#2567)Gravatar Miek Gieben 2-13/+40
Reload didn't take proper care to protect the fields from use in different goroutines. Add a mutex and add helpers for usage and interval. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-17plugin/auto: Reload zones every one minute (#2516)Gravatar mrasu 3-24/+66
Automatically submitted.
2019-02-17cleanup by fmt and remove redundant type declarations (#2563)Gravatar Sandeep Rajan 6-11/+11
2019-02-17Remove unused test case (#2562)Gravatar DO ANH TUAN 1-31/+0
2019-02-17Fix some typos (#2560)Gravatar Nguyen Quang Huy 8-9/+9
* Fix some typos Corect some words for reading more easily * Update NOERROR response code NOERROR is a response code so I revert the typo checking for it
2019-02-17Update A/PTR template README examples (#2553)Gravatar Brian Bao 1-6/+6
2019-02-14Change http to https for security links (#2559)Gravatar Nguyen Van Trung 1-2/+2
Signed-off-by: Nguyen Van Trung <trungnv@vn.fujitsu.com>
2019-02-12Adjust docs for [ADDRESS] in metrics plugin (#2555)Gravatar Anders Ingemann 1-3/+3
The [ADDRESS] field in the metrics plugin is not explained in a manner that makes it immediately obvious, that what we are talking about here is a listening address.
2019-02-12plugin/hosts provide more configuration flexibility (#2535)Gravatar Thomas Mangin 6-70/+163
* plugin/hosts provide more configuration flexibility This patch adds few features to the host plugin * no-reverse (both as first argument on the plugin line and inline) disable the automatic generation of reserve entries for hosts * ttl <duration> (inline only atm) allows to change the default ttl (default 5 minutes) * reload <duration> (inline only atm) allows to change the reloading interval (default 5s) * plugin/hosts remove superfluous parameters to parse
2019-02-12pkg/replace: make it more efficient. (#2544)Gravatar Miek Gieben 6-163/+243
* pkg/replace: make it more efficient. Remove the map that is allocated on every write and make it more static, but just defining a function that gets called for a label and returns its value. Remove the interface definition and just implement what is needed in our case. Add benchmark test for replace as well. Extend metadata test to test multiple values (pretty sure this didn't work, but there wasn't a test for it, so can't be sure). Update all callers to use it - concurrent use should be fine as we pass everything by value. Benchmarks in replacer: new: BenchmarkReplacer-4 300000 4717 ns/op 240 B/op 8 allocs/op old: BenchmarkReplacer-4 300000 4368 ns/op 384 B/op 11 allocs/op Added benchmark function to the old code to test it. ~~~ func BenchmarkReplacer(b *testing.B) { w := dnstest.NewRecorder(&test.ResponseWriter{}) r := new(dns.Msg) r.SetQuestion("example.org.", dns.TypeHINFO) r.MsgHdr.AuthenticatedData = true b.ResetTimer() b.ReportAllocs() repl := New(context.TODO(), r, w, "") for i := 0; i < b.N; i++ { repl.Replace("{type} {name} {size}") } } ~~~ New code contains (of course a different one). The amount of ops is more, which might be good to look at some more. For all the allocations is seems it was quite performant. This looks to be 50% faster, and there is less allocations in log plugin: old: BenchmarkLogged-4 20000 70526 ns/op new: BenchmarkLogged-4 30000 57558 ns/op Signed-off-by: Miek Gieben <miek@miek.nl> * Stickler bot Signed-off-by: Miek Gieben <miek@miek.nl> * Improve test coverage Signed-off-by: Miek Gieben <miek@miek.nl> * typo Signed-off-by: Miek Gieben <miek@miek.nl> * Add test for malformed log lines Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-11Remove grpc watch functionality (#2549)Gravatar Miek Gieben 14-611/+30
This was added, but didn't see any use. For a large, complex chunk of code we should have some users of it. Remove all watch functionally from plugins, servers and packages. Fixes: #2548 Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-11Fix t.Error error message (#2551)Gravatar JoeWrightss 2-2/+2
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-07Fix some spelling errors in comment (#2533)Gravatar JoeWrightss 2-2/+2
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-07Set klog's logtostderr flag (#2529)Gravatar Guy Templeton 1-2/+8
* Parse as well as setlogtostderr flag * Enforce setting of logtostderr for klog * Clearup comment on klog
2019-02-01support etcd credentials in etcd plugin (#2442)Gravatar Christophe de Carvalho 4-14/+74
* support etcd credentials in etcd plugin fixes #2441 * try to fix cleanup of authentication
2019-02-01Fix some typos in comment (#2520)Gravatar JoeWrightss 1-1/+1
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-01-30plugin/log: add test and benchmark (#2515)Gravatar ckcd 1-3/+156
2019-01-29skip pushing watch updates when there are no watches (#2513)Gravatar Chris O'Haver 1-0/+12
2019-01-29some typo fix (#2512)Gravatar Ye Ben 2-2/+2
Signed-off-by: yeya24 <ben.ye@daocloud.io>
2019-01-28plugin/etcd: Filter empty host field by qtype (#2499)Gravatar Carl-Magnus Björkell 4-6/+33
When a query, different from a TXT lookup is performed, all services with a missing `Host` field should be filtered out, as these otherwize cause a line in the answer section with a single dot (`.`) as the result. This behavior manifests for example when a TXT record is present on a domain, eg. an A or SRV lookup is performed on said domain. If there are no services containing a `Host` field, a `NODATA` response should be given. If there are other Services, these alone should be returned for the query. Filter any service that has an empty Host field from all lookup types other than TXT to solve this issue. At the same time the check for empty `Text` fields in TXT queries are also moved to the same check in the etcd ServiceBackend.
2019-01-28plugin/hosts: fix for ipv4-in-ipv6 (#2506)Gravatar Thomas Mangin 2-2/+18
* fix for ipv4-in-ipv6 * update comment as requested
2019-01-28Correct formatting of policies list (#2509)Gravatar Guy Templeton 1-0/+1
2019-01-27golint fix (#2504)Gravatar Yong Tang 1-4/+1
This PR is a small golint fix: ``` coredns/plugin/test/helpers.go Line 283: warning: redundant if ...; err != nil check, just return error instead. (golint) ``` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-27plugin/etcd: Fix REAME's ttl (#2502)Gravatar mrasu 1-4/+4
There are string ttls at commands at README.md. But because `TTL` of `Service` is uint32, commands at README is wrong. e.g.) `etcdctl put /skydns/local/skydns/x1 '{"host":"1.1.1.1","ttl":"60"}'`.
2019-01-27plugin/etcd: Remove unnecessary struct copy (#2497)Gravatar Carl-Magnus Björkell 1-4/+3
The `b` struct is just copying all the fields into a new one, to check if it already existed in a set. This isn't needed as all the fields are identical, and a small rearrangement of the code solves the same problem without the copy.
2019-01-23Update README.md (#2490)Gravatar Chris O'Haver 1-2/+2
2019-01-21plugin/hosts reload the hosts file every 5 seconds (#2478)Gravatar Thomas Mangin 1-0/+3
* inform users of the reload feature * modified as requested
2019-01-19Stop importing testing in the main binary (#2479)Gravatar Miek Gieben 37-180/+206
* Stop importing testing in the main binary Stop importing "testing" into the main binary: * test/helpers.go imported it; remote that and change function signature * update all tests that use this Signed-off-by: Miek Gieben <miek@miek.nl> * Drop import testing from metrics plugin Signed-off-by: Miek Gieben <miek@miek.nl> * more fiddling Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-19set ttl for ns records (#2452)Gravatar Chris O'Haver 2-9/+9
2019-01-15fix tls_servername in cloudflare example (#2466)Gravatar Rob Maas 1-1/+1
2019-01-13Deprecate multiple endpoints for out-of-cluster k8s api (#2454)Gravatar Yong Tang 4-72/+6
This fix deprecates endpoints for out-of-cluster k8s api, The Corefile still takes multiple endpoints though only the first one is used. A warning is shown if there are multiple endpoints. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-13Fix setup_test in plugin/kubernetes (#2460)Gravatar Miek Gieben 1-1/+0
PR race condition, fix the test data for the setup. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-13Default to upstream to self (#2436)Gravatar Miek Gieben 39-1080/+118
* Default to upstream to self This is a backwards incompatible change. This is a massive (cleanup) PR where we default to resolving external names by the coredns process itself, instead of directly forwarding them to some upstream. This ignores any arguments `upstream` may have had and makes it depend on proxy/forward configuration in the Corefile. This allows resolved upstream names to be cached and we have better healthchecking of the upstreams. It also means there is only one way to resolve names, by either using the proxy or forward plugin. The proxy/forward lookup.go functions have been removed. This also lessen the dependency on proxy, meaning deprecating proxy will become easier. Some tests have been removed as well, or moved to the top-level test directory as they now require a full coredns process instead of just the plugin. For the etcd plugin, the entire StubZone resolving is *dropped*! This was a hacky (but working) solution to say the least. If someone cares deeply it can be brought back (maybe)? The pkg/upstream is now very small and almost does nothing. Also the New() function was changed to return a pointer to upstream.Upstream. It also returns only one parameter, so any stragglers using it will encounter a compile error. All documentation has been adapted. This affected the following plugins: * etcd * file * auto * secondary * federation * template * route53 A followup PR will make any upstream directives with arguments an error, right now they are ignored. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix etcd build - probably still fails unit test Signed-off-by: Miek Gieben <miek@miek.nl> * Slightly smarter lookup check in upstream Signed-off-by: Miek Gieben <miek@miek.nl> * Compilez Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-10fix soa min ttl in tests cases (#2451)Gravatar Chris O'Haver 7-30/+30
2019-01-10set minttl to ttl setting (#2446)Gravatar Chris O'Haver 8-31/+31
2019-01-08plugin/kubernetes: fix case preservation and add test (#2430)Gravatar Chris O'Haver 3-4/+76
* fix case preservation and add test * only fix case in k8s
2019-01-08plugin/log: support multi nameScope (#2420)Gravatar ckcd 3-25/+69
2019-01-07Error out when multiple https endpoints are specified. (#2438)Gravatar Yong Tang 3-2/+26
This fix will error out when multiple https endpoints are specified, as additional work is needed to support beyond http. This fix fixes 1464. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>