aboutsummaryrefslogtreecommitdiff
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-24Coredns follows the CNCF Code of Conduct (#2597)Gravatar Nguyen Hai Truong 1-42/+2
Automatically submitted.
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-22Restore changes in vendor directory (#2594)Gravatar Yong Tang 1-1/+1
Part of the changes in 2591 modifies the vendor directory which should not be modified. `dep ensure` will change it back. This fix reverts the change of ``` vendor/github.com/apache/thrift/lib/go/thrift/simple_json_protocol.go ``` in 2591. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
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 2-2/+2
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 4-8/+8
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 9-9/+9
Signed-off-by: Nguyen Phuong An <AnNP@vn.fujitsu.com>
2019-02-19Correct misspelling of Kubernetes (#2579)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-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-17Upgrade caddy to 0.11.X (#2541)Gravatar Miek Gieben 2-1/+6
* Upgrade caddy to 0.11.2 Redo of #2505 (cherry-picked commit) Signed-off-by: Miek Gieben <miek@miek.nl> * .4 has been released 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-17Fix a flaky test by not depending on Google (#2565)Gravatar mrasu 1-50/+90
TestLookupAutoPathErratic sometimes fail on TravisCI saying below ``` === RUN TestLookupAutoPathErratic --- FAIL: TestLookupAutoPathErratic (8.30s) erratic_autopath_test.go:39: Test 0, failed to sent query: "read udp [::1]:39758->[::1]:56643: i/o timeout" FAIL ``` The failure happens when Google replies slowly. This PR changes to not use Google but run CoreDNS locally and proxy to the server. --- Because the failure depends on Google, sometimes it happens frequently but sometimes it doesn't happen. I hope following test help you reproduce it. ``` func TestLookupAutoPathErratic2(t *testing.T) { for i := 0; i < 200; i++ { TestLookupAutoPathErratic(t) } } ``` or I can reproduce it by changing proxy to other DNS like 1.1.1.1 instead of 8.8.8.8 too
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 unsorted imports (#2561)Gravatar Nguyen Quang Huy 1-1/+1
Imports should be sorted by Go coding convention
2019-02-17Fix some typos (#2560)Gravatar Nguyen Quang Huy 9-10/+10
* 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 4-10/+10
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 19-1011/+85
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-09Update README.md on compiling from GitHub (#2543)Gravatar Brian Bao 1-11/+11
2019-02-09Fix etcd_cache_test to runnable multiple times. (#2546)Gravatar mrasu 1-0/+12
Currently, when you run `TestEtcdCredentials` at etcd_credentials_test.go multiple times without clearing data of etcd, you will get following errors. ``` etcd_credentials_test.go:38: Failed to create root role: etcdserver: role name already exists etcd_credentials_test.go:41: Failed to create user: etcdserver: user name already exists ```
2019-02-08Add CONTRIBUTING symlink (#2540)Gravatar Miek Gieben 1-0/+1
symlink from within .github This should be enough to show it in pull request; unless github has something against symlinks. Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-08Ask if the PR introduces backward incompatibility (#2538)Gravatar Chris O'Haver 1-0/+2
2019-02-08doc: update CONTRIBUTING.md (#2530)Gravatar Miek Gieben 1-77/+26
* doc: update CONTRIBUTING.md Remove bunch of old/stale text, but add a section (and clarify) using issues to describe a future PR and that those need to be small (if you want it merged faster) Signed-off-by: Miek Gieben <miek@miek.nl> * Update CONTRIBUTING.md Co-Authored-By: miekg <miek@miek.nl>
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-03Fix broken link (#2522)Gravatar Kenjiro Nakayama 1-1/+1
This patch fixes broken link in README.md
2019-02-02Update to dns/1.1.4 (#2521)Gravatar Miek Gieben 1-1/+1
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-01support etcd credentials in etcd plugin (#2442)Gravatar Christophe de Carvalho 6-14/+156
* support etcd credentials in etcd plugin fixes #2441 * try to fix cleanup of authentication
2019-02-01Fix some typos in comment (#2520)Gravatar JoeWrightss 3-3/+3
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 5-8/+8
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-28Remove duplicated TempFile testsuit (#2508)Gravatar Xuanwo 8-31/+25
2019-01-27readme: add text on backward incompat changes (#2470)Gravatar Miek Gieben 1-3/+17
* readme: add text on backward incompat changes Document the process of releasing backwards incompatible changes. Signed-off-by: Miek Gieben <miek@miek.nl> * slightly better Signed-off-by: Miek Gieben <miek@miek.nl> * Add an example Signed-off-by: Miek Gieben <miek@miek.nl> * Be more explicit in naming the segments increased Signed-off-by: Miek Gieben <miek@miek.nl>
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>