Commit graph

1844 commits

Author SHA1 Message Date
Miek Gieben
cd5dcebe93
core: log panics (#3072)
These are too hidden now. They increase the issue-load, because people
don't see them.

Add log.Errorf in the core/dnsserver recover routine.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-31 18:18:49 +00:00
Alan
7be2226eab fix ineffectual assignment to err (#3066)
Signed-off-by: alan <zg.zhu@daocloud.io>
2019-07-31 06:47:46 +00:00
Yong Tang
b8f40a8150 Move github.com/openzipkin/zipkin-go-opentracing => github.com/openzipkin-contrib/zipkin-go-opentracing (#3070)
Move github.com/openzipkin/zipkin-go-opentracing => github.com/openzipkin-contrib/zipkin-go-opentracing
and run `go mod tidy`

Fixes 3069

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-31 06:44:56 +00:00
Erik Wilson
367d285765 plugin/reload: Graceful reload of imported files (#3068)
Automatically submitted.
2019-07-30 22:44:16 +00:00
Miek Gieben
4fda9535d2
plugin/kubernetes: remove some of the klog setup (#3054)
I don't believe this is actually needed (anymore). The:

os.Stderr = os.Stdout

is a crazy hack that def. needs to go.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-30 16:35:07 +00:00
dependabot-preview[bot]
6cea8869cf build(deps): bump gopkg.in/DataDog/dd-trace-go.v1 from 1.16.0 to 1.16.1 (#3061)
Bumps [gopkg.in/DataDog/dd-trace-go.v1](https://github.com/DataDog/dd-trace-go) from 1.16.0 to 1.16.1.
- [Release notes](https://github.com/DataDog/dd-trace-go/releases)
- [Commits](https://github.com/DataDog/dd-trace-go/compare/v1.16.0...v1.16.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-29 08:10:42 -07:00
dzzg
7122fda09d cleanup: error message typos in setup_test.go (#3065)
Signed-off-by: zhengguang zhu <zhengguang.zhu@daocloud.io>
2019-07-29 07:58:45 -07:00
dependabot-preview[bot]
c3516279ed build(deps): bump github.com/aws/aws-sdk-go from 1.21.2 to 1.21.6 (#3060)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.21.2 to 1.21.6.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.21.2...v1.21.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-29 06:55:36 -07:00
dependabot-preview[bot]
f50e1dc912 build(deps): bump google.golang.org/grpc from 1.22.0 to 1.22.1 (#3062)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.22.0 to 1.22.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.22.0...v1.22.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-29 06:55:23 -07:00
AllenZMC
79f352d2b3 fix typos in coredns-1.5.2.md (#3063) 2019-07-29 09:35:29 -04:00
Miek Gieben
0a218d3cf4
Tag v1.6.0 (#3059)
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-28 20:00:28 +00:00
Michael Grosser
5a2a422b38
Fix typo 2019-07-28 10:03:46 +00:00
Miek Gieben
4ecc9c4c43
release: coredns 1.6.0 release (#3058)
* fix the notes and set release date to today
* run a 'make -f Makefile.doc' to generate the manal pages.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-28 10:02:52 +00:00
Miek Gieben
b209cb162c
contrib: add words on adding new plugins (#3057)
* contrib: add words on adding new plugins

New plugins are usually dropped in one giant ball of code, add some
words on how this can be approached and made to work faster.

(will at least give us something to point at)

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

* Update CONTRIBUTING.md

Co-Authored-By: Michael Grosser <development@stp-ip.net>

* Update CONTRIBUTING.md

Co-Authored-By: Michael Grosser <development@stp-ip.net>

* Update CONTRIBUTING.md

Co-Authored-By: Michael Grosser <development@stp-ip.net>

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

Co-Authored-By: Michael Grosser <development@stp-ip.net>
2019-07-28 10:02:38 +00:00
Miek Gieben
92a636df53 plugin/file: z.Expired needs be read under a rlock (#3056)
Read lock before reading the Expired field of a zone.

Fixes: #3053

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-27 08:06:50 -07:00
Miek Gieben
7a3371d740
plugin/file: allow README.md testing (#3052)
* Fix corefile usage

* plugin/file: allow README.md testing

Allow readme testing for the file plugin and fix bugs that where found:

* the reader wasn't reset when re-reading the same io.reader for a
  different origin.

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

* Update test/example_test.go

Co-Authored-By: Michael Grosser <development@stp-ip.net>
2019-07-27 11:47:55 +00:00
Miek Gieben
cfc4948f92
More note tweaks; couple of typos for 1.6.0 (#3049)
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-26 07:10:49 +00:00
Yong Tang
e5b44f4bd3 Update CONTRIBUTING.md for dependency update methods (go dep -> go mod) (#3048)
* Update CONTRIBUTING.md for dependency update methods (go dep -> go mod)

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

* Small fix for reveiw comment

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-25 21:55:26 +00:00
Chris O'Haver
4f268ad801 update to client-go 12.0.0 (#3047) 2019-07-25 13:24:12 -07:00
Yong Tang
ee6c5f87d1
Update CONTRIBUTING.md (#3046)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-25 13:20:23 -07:00
Miek Gieben
89fa9bc61e plugin/host: don't append the names when reparsing hosts file (#3045)
The host plugin kept on adding entries instead of overwriting. Split the
inline cache off from the /etc/hosts file cache and clear /etc/hosts
file cache and re-parsing.

A bunch of other cleanup as well. Use functions defined in the plugin
package, don't re-parse strings if you don't have to and use To4() to
check the family for IP addresses. Fix all test cases a carried entries
are always fqdn-ed. Various smaller cleanup in unnessacry constants.

Fixes: #3014

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-25 11:53:07 -07:00
Miek Gieben
2a41b9a93b
Add 1.6.0 release notes (#3044)
* Add 1.6.0 release notes

Preliminary notes for the 1.6.0 release

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

* Update notes/coredns-1.6.0.md

Co-Authored-By: Michael Grosser <development@stp-ip.net>

* Update notes/coredns-1.6.0.md

Co-Authored-By: Michael Grosser <development@stp-ip.net>
2019-07-25 13:42:02 +00:00
Erfan Besharat
048987fca5 plugin/file: Add SOA serial to axfr log (#3042) 2019-07-24 17:39:07 +00:00
Miek Gieben
eba020e6a1
plugin/file: simplify locking (#3024)
* plugin/file: simplify locking

Simplify the locking, remove the reloadMu and just piggyback on the
other lock for accessing content, which assumes things can be move
underneath.

Copy the Apex and Zone to new vars to make sure the pointer isn't
updated from under us.

The releadMu isn't need at all, the time.Ticker firing while we're
reading means we will just miss that tick and get it on the next go.

Add rrutil subpackage and put some more generic functions in there, that
are now used from file and the tree package. This removes some
duplication.

Rename additionalProcessing that didn't actually do that to
externalLookup, because that's what being done at some point.

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

* Update plugin/file/lookup.go

Co-Authored-By: Michael Grosser <development@stp-ip.net>
2019-07-23 18:32:44 +00:00
dependabot-preview[bot]
637bd3c7dc build(deps): bump github.com/aws/aws-sdk-go from 1.21.1 to 1.21.2 (#3032)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.21.1 to 1.21.2.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.21.1...v1.21.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-23 07:44:47 -07:00
Mat Lowery
dae6aea292 Fix response_rcode_count_total metric (#3029) 2019-07-23 06:23:16 +00:00
dependabot-preview[bot]
2153cada45 build(deps): bump github.com/aws/aws-sdk-go from 1.21.0 to 1.21.1 (#3027)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.21.0 to 1.21.1.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.21.0...v1.21.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-22 06:55:41 +00:00
Miek Gieben
01e13c622e plugin/file: New zone should have zero records (#3025)
After calling NewZone the number of records should be zero, but due to
how zone.All() was implemented so empty RRs would be added. This then
fails the == 0 check in xfr.go and put nil in the slice, this then
subsequently panics on the Len().

Fix this making All() smarter when adding records. Added little test to
enfore this.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-20 11:13:43 -07:00
dependabot-preview[bot]
f7b26db9d0 build(deps): bump github.com/aws/aws-sdk-go from 1.20.20 to 1.21.0 (#3022)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.20.20 to 1.21.0.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.20.20...v1.21.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-19 09:19:35 +00:00
Charlie Vieth
031dfede90 pkg/cache: fix race in Add() and Evict() (#3013)
* pkg/cache: fix race in Add() and Evict()

This fixes a race in Add() when the shard is at max capacity and the key
being added is already stored.  Previously, the shard would evict a
random value - when all it needed to do was replace an existing value.
There was a race in how Evict() picked which key to remove, which would
cause concurrent calls to Evict() to remove the same key.

Additionally, this commit removes a lot of the lock contention and a
race around Add() and Evict() by changing them to immediately hold the
write lock.  Previously, they would check conditions with the read lock
held and not re-check those conditions once the write lock was acquired
(this is a race).

* pkg/cache: code review comments

* pkg/cache: simplify Add() logic
2019-07-19 09:19:03 +00:00
Christian Muehlhaeuser
c928dbd754 Added comment why ominous assignment is required (#3021) 2019-07-19 06:31:29 +00:00
Christian Muehlhaeuser
d0c9254409 Fixed typo in 'transferred' (#3020)
Just a nitpicky typo fix.
2019-07-19 06:06:26 +00:00
Miek Gieben
1d5095cf67
plugin/file: Rename do to walk and cleanup and document (#2987)
* plugin/file: Rename do to walk, cleanup and document

* This renames Do to Walk to be more inline with Go standards. Also make
  it return an error instead of a bool.
  Also give give walk access to rrs. Alternatively e.m could be
  exported, but just access the map of rrs should work as well. Another
  alternative would be adding a whole bunch of helper functions, but
  those need grab and return the data. Just having access to the rrs
  should be easiest for most Walks.
* It adds Type and TypeForWildcard to show the different functions
* *Removes* the identical RR check when inserting; this was only done
  for A, AAAA and MX and not finished; removed under the mantra garbage
  in garbage out.
* Reuses Types to return all the types in an *tree.Elem

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

* better comments

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-18 17:44:47 +00:00
dependabot-preview[bot]
527772fc5f build(deps): bump gopkg.in/DataDog/dd-trace-go.v1 from 1.15.0 to 1.16.0 (#3018)
Bumps [gopkg.in/DataDog/dd-trace-go.v1](https://github.com/DataDog/dd-trace-go) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/DataDog/dd-trace-go/releases)
- [Commits](https://github.com/DataDog/dd-trace-go/compare/v1.15.0...v1.16.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-18 09:41:09 -07:00
Miek Gieben
6c9a599761
plugin/file: fix setting ReloadInterval (#3017)
* plugin/file: fix setting ReloadInterval

The reload interval was only correctly set if there was an extra
block for the file. Move this down to set up.

Add test case that fails before, but now works.

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

* layout and use Errorf

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-18 14:56:59 +00:00
Miek Gieben
eefe49dd3e plugin/route53: small doc cleanups (#3016)
Adjust style to rest fo the plugins.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-17 13:40:15 -07:00
Charlie Vieth
a2af651ecb replacer: evaluate format once and improve perf by ~3x (#3002)
* replacer: evaluate format once and improve perf by ~3x

This improves the performance of logging by almost 3x and reduces memory
usage by ~8x.

Benchmark results:

benchmark                                old ns/op     new ns/op     delta
BenchmarkReplacer-12                     644           324           -49.69%
BenchmarkReplacer_CommonLogFormat-12     4228          1471          -65.21%

benchmark                                old allocs     new allocs     delta
BenchmarkReplacer-12                     8              2              -75.00%
BenchmarkReplacer_CommonLogFormat-12     51             17             -66.67%

benchmark                                old bytes     new bytes     delta
BenchmarkReplacer-12                     240           48            -80.00%
BenchmarkReplacer_CommonLogFormat-12     3723          446           -88.02%

* replacer: code review comments

* bufPool: document why we use a pointer to a slice
* parseFormat: fix confusing comment
* TestParseFormat_Nodes: rename to TestParseFormatNodes

* replacer: use a value for bufPool instead of a pointer

* replacer: remove comment

* replacer: replace labels with knownLabels

The previous slice of label names is no longer needed.
2019-07-17 06:57:46 +00:00
Charlie Vieth
21e9c6047b Fix log plugin benchmark and slightly improve performance (#3004)
* log: use ioutil.Discard as write buffer in benchmark

Using a buffer gives unrealistic stats and consumes a large amount of
memory.

* log: lazily check if a msg should be logged

* log: improve variable name

Change 'ok' to the more descriptive 'shouldLog'.

* log: code comments: don't reuse variable
2019-07-16 19:00:22 +00:00
dependabot-preview[bot]
767d399877 build(deps): bump github.com/aws/aws-sdk-go from 1.20.17 to 1.20.20 (#3006)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.20.17 to 1.20.20.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.20.17...v1.20.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-16 06:47:01 +00:00
Anshul Sharma
0674325efb plugin/route53: fix IAM credential file (#2983)
- Fix the ability for CoreDNS to fetch credentials via IAM
2019-07-15 05:56:28 +00:00
Jintao Zhang
2874c963c1 doc:remove duplicate word (#3005)
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2019-07-15 05:51:08 +00:00
Charlie Vieth
db417f97af rewrite: remove condition file (#3003)
Nothing it declares is used by CoreDNS and it does not appear to be used
by any third-party packages (according to godoc.org).
2019-07-14 08:44:00 +00:00
Miek Gieben
2213a12d21
Scrub: TC bit is always set (#3001)
miekg/dns recently became more aggressive in setting TC; anything that's
chopped of a response results in TC. Amend the tests. Disputable if
these TC checks still add something.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-12 12:33:27 +00:00
Ruslan Drozhdzh
69a2397bf5 plugin/rewrite: fix domain length validation (#2995)
* unit test

* fix domain length validation

* code optimization

* remove unit test
2019-07-12 12:22:45 +00:00
Miek Gieben
a5c405f6d7
Move to dns.Truncate (#2942)
Ditch our truncation code and use the upstream one in miekg/dns.
This saves code on our end, end upstream is also more efficient as every
RR is Len-ed only once. With our bin-search this is not guaranteed.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-11 12:54:47 +00:00
dependabot-preview[bot]
1ee9b534ab build(deps): bump github.com/golang/protobuf from 1.3.1 to 1.3.2 (#2989)
Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](https://github.com/golang/protobuf/compare/v1.3.1...v1.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-11 06:32:57 +00:00
dependabot-preview[bot]
e1ab8a8ce2 build(deps): bump github.com/aws/aws-sdk-go from 1.20.15 to 1.20.17 (#2990)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.20.15 to 1.20.17.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.20.15...v1.20.17)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-11 06:31:03 +00:00
Yong Tang
f4a6bea4b4 gofmt fix for No newline at end of file (#2973)
This fix fixes the `\ No newline at end of file`
in plugin/chaos/zowners.go, by adding `"\n"`
to the end of owners_generate.go.

Also fixes a gofmt issue in plugin/etcd/setup.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-04 07:50:49 +01:00
Yong Tang
9b6e2aa5a6 Update github.com/miekg/dns, github.com/aws/aws-sdk-go, and google.golang.org/grpc (#2960)
This fix updates:
- github.com/miekg/dns to 1.15 (#2947)
- github.com/aws/aws-sdk-go to 1.20.13 (#2953)
- google.golang.org/grpc to 1.22.0 (#2966)

This fix fixes #2947
This fix fixes #2953
This fix fixes #2966

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-04 07:44:31 +01:00
Miek Gieben
18304ce9b7 plugin/file: make non-existent file non-fatal (#2955)
* plugin/file: make non-existent file non-fatal

If the zone file being loaded doesn't exist *and* reload is enabled,
just wait the file to pop up in the normal Reload routine.

If reload is set to 0s; we keep this a fatal error on startup. Aslo fix
the ticker in z.Reload(): remove the per second ticks and just use the
reload interval for the ticker.

Brush up the documentation a bit as well.

Fixes: #2951

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

* Stickler and test compile

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

* Remove there too

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

* Cant README test these because zone files dont exist

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-04 13:56:37 +08:00