Commit graph

1749 commits

Author SHA1 Message Date
Yong Tang
dfa413af09 Update README.md to remove the description of vendoring (#2650)
Since we already removed vendor directory.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-03-04 07:30:15 +00:00
Yong Tang
5e5c31edfe Update README.md to use go 1.12 (#2649)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-03-04 07:19:50 +00:00
Yong Tang
9d39ea51a7
Add go mod support (#2503)
* Remove vendor and go-dep

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Add go.mod

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Update Makefile and .travis.yml

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-03-03 11:56:26 -08:00
Miek Gieben
39d94835ee
fix typo in notes (#2648)
Copied from https://github.com/coredns/coredns.io/pull/133

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-03 19:27:54 +00:00
Yong Tang
b039f5cc67 Update to 1.12.x (#2646)
Automatically submitted.
2019-03-03 14:58:31 +00:00
Miek Gieben
1e9fa297e7 Add release notes into coredns repo (#2645)
* Put release notes in notes subdir

Verbatim copy of the current set of notes on coredns.io. Copy them
here to make them authoritative.

'make sync' on the coredns.io site copies them back in. They need to be
formatted in Hugo style.

Signed-off-by: Miek Gieben <miek@miek.nl>

* pull latest

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-03 06:43:09 -08:00
Miek Gieben
8dcc7fccd7
up the version to 1.4.0 (#2642)
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-03 10:41:41 +00:00
Miek Gieben
b9fc38a166
make -f Makefile.doc (#2641)
few changes before the 1.4.0 release.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-03 09:35:36 +00:00
Miek Gieben
824367e8e6
plugin/reload: add bug text about import (#2638)
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-02 09:03:25 +00:00
Ruslan Drozhdzh
e3e3249016 plugin/forward: check message Id when reading from upstream server (#2637) 2019-03-01 14:40:52 +00:00
JoeWrightss
352a042362 Fix some misspells in comment (#2634)
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-03-01 10:49:22 +00:00
Miek Gieben
7ffa4f19bb Regen man-pages (#2631)
Mechanical change: make -f Makefile.doc

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-27 12:32:48 -08:00
Nguyen Quang Huy
42cf6606fc Fix error string should not be capitalized (#2608)
From [Golang coding convention](https://github.com/golang/go/wiki/CodeReviewComments#error-strings)

Co-Authored-By: Nguyen Van Trung [trungnvfet@outlook.com](mailto:trungnvfet@outlook.com)
Signed-off-by: Nguyen Quang Huy [huynq0911@gmail.com](mailto:huynq0911@gmail.com)
2019-02-27 08:25:02 -05:00
Nguyen Van Duc
c8dbfbdcd8 Add .gitignore files for Eclipse (#2627)
Signed-off-by: vanduc95 <ducnv@vn.fujitsu.com>
2019-02-27 01:07:45 -08:00
tuanvcw
5c46d6c6ef Fix some minor typos (#2625)
Signed-off-by: Vu Cong Tuan <tuanvc@vn.fujitsu.com>
2019-02-27 08:02:50 +00:00
Nguyen Hai Truong
a727747794 Insert *~ when using emacs in .gitignore (#2623)
Ignore temporary files *~ when editting source codes with
emacs.

Co-Authored-By: Dao Cong Tien tiendc@vn.fujitsu.com
Signed-off-by: Nguyen Hai Truong <truongnh@vn.fujitsu.com>
2019-02-27 07:59:54 +00:00
Nguyen Hai Truong
6dfe6b7c61 Ignore DS_Store in file .gitignore (#2622)
Signed-off-by: Nguyen Hai Truong <truongnh@vn.fujitsu.com>
2019-02-26 09:09:38 -08:00
Andrey Meshkov
2b6fb578c3 DoH: Fixing panic in case if there's no response (#2577)
* Fixing panic in case if there's no response

There could be a situation when there's no response after ServeDNS call. With the current implementation, this leads to panic.

* Add comment
2019-02-25 16:16:17 +00:00
Miek Gieben
47cce40d19 Add benchmark test (#2610)
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-25 06:57:27 -08:00
LongKB
780a433de8 Update deprecated link in doc (#2607)
Currently, the modified link is out of date. This patch aims to update
this link to the working one that user can access.

Co-Authored-By: Nguyen Phuong An <AnNP@vn.fujitsu.com>
Signed-off-by: Kim Bao Long <longkb@vn.fujitsu.com>
2019-02-24 18:17:52 -08:00
Miek Gieben
78b26c4678 plugin/kubernetes: create dns.Msg later (#2604)
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-24 08:04:07 -08:00
Nguyen Hai Truong
a215e4f768 Coredns follows the CNCF Code of Conduct (#2597)
Automatically submitted.
2019-02-24 12:56:13 +00:00
Darshan Chaudhary
70fcbbf6ba refactor tests to remove duplicate code (#2602)
Signed-off-by: darshanime <deathbullet@gmail.com>
2019-02-23 09:02:58 -08:00
JoeWrightss
92b7136684 Fix some typos in comment (#2599)
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-22 09:14:03 -05:00
Yong Tang
8953722327 Restore changes in vendor directory (#2594)
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-22 07:35:05 +00:00
Nguyen Hai Truong
9ce9308f5c Trivial fix typo (#2590)
Although it is spelling mistakes, it might make an affects
while reading.

Signed-off-by: Nguyen Hai Truong <truongnh@vn.fujitsu.com>
2019-02-21 07:23:34 +00:00
LongKB
c8ba2d3ca8 Replacing 'HTTP' by 'HTTPS' for securing links (#2591)
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-21 07:21:25 +00:00
Xiao An
05c0f7161b Fix some typos in documents (#2592)
Signed-off-by: Xiao An <hac@zju.edu.cn>
2019-02-21 07:15:17 +00:00
Miek Gieben
34f17b276a
Fix typo: rrflags -> rflags (#2587)
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-21 07:13:05 +00:00
Guillaume Gelin
8691edd69d Fix typos (#2584) 2019-02-20 18:22:01 -08:00
Nguyen Hai Truong
39b0b91d6c Remove redundant words in comments (#2589)
Although it is spelling mistakes, it might make an affects
while reading.

Signed-off-by: Nguyen Hai Truong <truongnh@vn.fujitsu.com>
2019-02-20 18:20:48 -08:00
Nguyen Phuong An
e78d9a7893 Remove some duplicate worlds (#2582)
Signed-off-by: Nguyen Phuong An <AnNP@vn.fujitsu.com>
2019-02-20 07:12:21 -05:00
Nguyen Hai Truong
3c23aac2d3 Correct misspelling of Kubernetes (#2579)
Although it is spelling mistakes, it might make an affects
while reading.

Signed-off-by: Nguyen Hai Truong <truongnh@vn.fujitsu.com>
2019-02-19 07:27:15 +00:00
Uladzimir Trehubenka
4651cc621d plugin/forward: fixed debug dump output on FORMERR (#2576) 2019-02-18 07:12:14 +00:00
Miek Gieben
6d2189201e plugin/hosts: fix data race on h.size (#2573)
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-17 11:34:07 -08:00
Miek Gieben
2743c8eab1
Upgrade caddy to 0.11.X (#2541)
* 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-17 15:11:19 +00:00
Miek Gieben
a72f3a161c
plugin/reload: fix data races (#2567)
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-17 14:57:36 +00:00
mrasu
362d7e96dc plugin/auto: Reload zones every one minute (#2516)
Automatically submitted.
2019-02-17 14:51:47 +00:00
mrasu
643dfd7419 Fix a flaky test by not depending on Google (#2565)
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-17 08:33:51 +00:00
Sandeep Rajan
d42d80c4f6 cleanup by fmt and remove redundant type declarations (#2563) 2019-02-17 08:32:28 +00:00
DO ANH TUAN
1fe66443a7 Remove unused test case (#2562) 2019-02-17 08:31:58 +00:00
Nguyen Quang Huy
35982bd27d Fix unsorted imports (#2561)
Imports should be sorted by Go coding convention
2019-02-17 08:31:32 +00:00
Nguyen Quang Huy
8d09cb243f Fix some typos (#2560)
* 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-17 08:31:12 +00:00
Brian Bao
871bce3a23 Update A/PTR template README examples (#2553) 2019-02-17 08:29:16 +00:00
Nguyen Van Trung
de2f63d787 Change http to https for security links (#2559)
Signed-off-by: Nguyen Van Trung <trungnv@vn.fujitsu.com>
2019-02-14 20:18:32 -08:00
Anders Ingemann
008f9eb8b9 Adjust docs for [ADDRESS] in metrics plugin (#2555)
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-12 09:54:54 -08:00
Thomas Mangin
4b402e000d plugin/hosts provide more configuration flexibility (#2535)
* 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-12 09:09:33 -07:00
Miek Gieben
e47d881461
pkg/replace: make it more efficient. (#2544)
* 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-12 07:38:49 +00:00
Miek Gieben
29cb00aada
Remove grpc watch functionality (#2549)
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-11 14:46:53 +00:00
JoeWrightss
f69819387d Fix t.Error error message (#2551)
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-11 07:23:05 +00:00