Commit graph

1250 commits

Author SHA1 Message Date
Miek Gieben
07748d0c34
go report card fixes (#3182)
Went over the list at https://goreportcard.com/report/github.com/coredns/coredns
and removed/fix some code to make it slightly happier.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-24 18:14:25 +00:00
Miek Gieben
62451fd3eb
fuzzing: allow setup function to be called (#3175)
This allows to fuzzing of more interesting targets that require setup.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-24 18:13:47 +00:00
Chris O'Haver
59e74eb15d correct test and code (#3184) 2019-08-23 11:51:42 -07:00
Chris O'Haver
338d148c78 plugin/k8s_external/kubernetes: handle NS records (#3160)
* fix external ns records

* use k8s service name for ns record

* update test, add func comment

* expand nsAddrs() test cases

* support local ipv6 ip

* use less confusing pod ip in test
2019-08-23 16:54:06 +00:00
wwgfhf
1590320ff2 fix typo (#3180) 2019-08-23 06:29:17 +00:00
Miek Gieben
9f49d694e9 fuzz: fix rewrite crash by fixing fuzz/do.go (#3178)
Automatically submitted.
2019-08-22 18:49:22 +00:00
xieyanker
f8e0ae6330 fix typo "dnstop" >> "dnstap" (#3170) 2019-08-22 16:44:25 +00:00
Guangming Wang
7918190901 Cleanup: fix some typos in code comment (#3172)
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-22 14:35:55 +00:00
AllenZMC
434ac69a03 fix wrong spells in parse_test.go (#3173) 2019-08-22 09:59:12 -04:00
Chris O'Haver
3f47fc8ba4
typo fixes (#3169)
* spelling fixes

* its/it's
2019-08-21 16:08:55 -04:00
AllenZMC
27f44f60ee fix mis-spelling in clouddns.go (#3166) 2019-08-21 06:16:00 -07:00
AllenZMC
8ab83a175a fix mis-spelling in item.go (#3156) 2019-08-19 09:36:59 -04:00
Xigang Wang
81bba80159 Change the ToEndpoints method comment to replace the Service with Endpoints (#3146) 2019-08-19 09:34:09 -04:00
Miek Gieben
6f028d0427
fuzz: some cleanups (#3143)
* fuzz: some cleanups

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

* smaller

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

* documentation

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

* comments

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-19 08:06:25 +00:00
Yong Tang
6402cef337
Move federation plugin to github.com/coredns/federation (#3139)
* Remove federation

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

* Rebuild and point to github.com/coredns/federation

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

* Export `localNodeName` => `LocalNodeName`, to be used by federation (until deprecation)

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

* Remove plugin/kubernetes/federation.go (=> kubernetes/federation repo)

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

* Update github.com/coredns/federation

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

* sticker-ci fix

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-08-18 14:41:51 -07:00
Miek Gieben
bbc78abf6f
plugin/clouddns: tiny fixes for the README (#3140)
* plugin/clouddns: tiny fixes for the README

Did a post-merge review. Fix a few typos.

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

* Naming;

coredns -> CoreDNS
clouddns -> Cloud DNS
and italics then the plugin's name are mentioned.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-18 08:40:34 +00:00
Yong Tang
b53d822e62 Additional content in clouddns plugin, and format of markdown (#3138)
This PR adds some content in clouddns plugin to mention about
the fact that privately hosted zone does not need to attach to
a VPC.
Also change PROJECT_NAME to PROJECTT_ID, and reformt the markdown
to replace tab with 4 whitespace.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-08-17 21:46:48 +00:00
Palash Nigam
194b0f95b4 Add Google Cloud DNS plugin (#3011)
Signed-off-by: Palash Nigam <npalash25@gmail.com>

Closes: #2822
2019-08-17 13:59:09 -07:00
AllenZMC
bde393096f fix wrong spells in zone.go (#3135) 2019-08-17 15:29:46 +00:00
zhangguoyan
86edb15c27 plugin/forward: fix a typo (#3133) 2019-08-16 16:34:12 +00:00
AllenZMC
d36ca09c97 fix mis-spelling in object.go (#3134) 2019-08-16 09:29:06 -04:00
AllenZMC
fe60f10300 fix typos in kubernetes.go (#3132) 2019-08-15 09:15:23 -04:00
Cricket Liu
d42f54467f Update README.md (#3131)
Just minor textual cleanup.
2019-08-14 13:48:14 -04:00
Miek Gieben
fcbe70f4f8
run gofmt -w -s **/*.go (#3126)
format and simplify; highlighted some stuff in route53_test.go that
could be further simplified.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-14 07:56:12 +00:00
AllenZMC
3c45e55f91 Update parse.go (#3122) 2019-08-13 09:47:23 -07:00
Miek Gieben
ebc465d0dc plugin/route53: various updates (#3108)
In the setup function use plugin.Error() to wrap the errors with the
plugin name. Because there isn't a separate setup() function this is
done for all returned errors.

Remove *upstream.Upstream from the New parameters as this is always set
and adjust the tests to account for this.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-13 08:02:29 -07:00
Chris O'Haver
a64ff8cc0a fix NXDOMAIN/NODATA fallthough case (#3118) 2019-08-12 18:43:22 +00:00
Andrey Meshkov
1ef24a8813 Fix handling truncated responses in forward (#3110)
* Fix handling truncated responses in forward

* Removed error check after proxy.Connect
See https://github.com/coredns/coredns/pull/3110/files#r312942826
2019-08-12 18:24:16 +00:00
Chris O'Haver
3a59c833a0 plugin/kubernetes: Don't do a zone transfer for NS requests (#3098)
* fix switch order

* remove fallthough

* add test

* fix test

* distingush nxdomain/nodata for at least first subdomain of zone

* restore fallthough; reorder switch cases
2019-08-09 21:14:48 +00:00
Miek Gieben
6a6e9a9b33 mechanical: run: go gen and make -f Makefile.doc (#3104)
no manual updates; just generated stuff.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-09 08:40:30 -07:00
Miek Gieben
1bb753c5b0 plugin/azure: clean up readme (#3102)
document the environment option and some cleanups. Go over the code and
fix/tweak random bits here and there.

Condense a few lines here and there.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-09 08:10:26 -07:00
Darshan Chaudhary
879466b028 Add plugin for Azure DNS (#2945)
* Add plugin for Azure DNS

Signed-off-by: darshanime <deathbullet@gmail.com>

* Rename AzureDNS plugin to Azure

Signed-off-by: darshanime <deathbullet@gmail.com>

* remove upstream from azure syntax

Signed-off-by: darshanime <deathbullet@gmail.com>

* Rename azure plugin block keynames

Signed-off-by: darshanime <deathbullet@gmail.com>

* Normalize zone name before lookup in zones

Signed-off-by: darshanime <deathbullet@gmail.com>

* Update import path for caddy

Signed-off-by: darshanime <deathbullet@gmail.com>

* normalize azure zone name only if required

Signed-off-by: darshanime <deathbullet@gmail.com>

* Add support for MX, SRV, TXT, records

Signed-off-by: darshanime <deathbullet@gmail.com>

* Add specs for new record types

Signed-off-by: darshanime <deathbullet@gmail.com>

* Use sequential updates for zones

Signed-off-by: darshanime <deathbullet@gmail.com>

* Add OWNERS file for azure plugin

Signed-off-by: darshanime <deathbullet@gmail.com>

* Rename imports for third party packages

Signed-off-by: darshanime <deathbullet@gmail.com>

* Capitalize values in README

Signed-off-by: darshanime <deathbullet@gmail.com>

* Shorten keys for azure plugin config

Signed-off-by: darshanime <deathbullet@gmail.com>

* Fixup readme for azure plugin

Signed-off-by: darshanime <deathbullet@gmail.com>
2019-08-09 08:10:28 +01:00
ethan
5b74d0f957 metrics.go: hemp message correction (#3100)
Signed-off-by: ethan <guangming.wang@daocloud.io>
2019-08-08 18:27:53 +02:00
Matt Kulka
94468c41b0 plugin/route53: make refresh frequency adjustable (#3083)
the current update frequency for the refresh loop in the route 53 plugin is hard-coded
to 1 minute. aws rate-limits the number of api requests so less frequent record refreshes
can help when reaching those limits depending upon your individual scenarios. this pull
adds a configuration option to the route53 plugin to adjust the refresh frequency.

thanks for getting my last pull released so quickly. this is the last local change that
i have been running and would love to get it contributed back to the project.

Signed-off-by: Matt Kulka <mkulka@parchment.com>
2019-08-03 18:07:28 -07:00
Miek Gieben
fc1e313ca7 plugin/file: unify a serial logging (#3088)
Use %d SOA serial when logging about the SOA serial.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-03 02:31:01 -07:00
Miek Gieben
a01b202b6a Fixes races in test and klog (#3079)
Various fixes to make things less flaky:

* kubernetes: put klog.SetOutput in the setup function, not in the init
  function to see if that helps
* file: make z.Expired a boolean instead of a pointer to a boolean
* test: fix TestSecondaryZoneTransfer test, which wasn't actually
  testing in the right way. It's more right now, but may still be racy
  (race introduced because a file's lazy loading of zones)

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-01 05:51:37 -07:00
Miek Gieben
07f016191d
plugin/hosts: create inline map in setup (#3071)
* plugin/hosts: create inline map in setup

The inline map wasn't create in the setup.go fuction leading to a crash,
which is masked by a recover (but leads to a SERVFAIL, and not logging
the request).

Various other simplifications.

host plugin could use some test that actually cover these edgecases.

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

* PR review changes

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-31 19:37:09 +00:00
Matt Kulka
45e17c325c [plugin/route53]: Increase ListResourceRecordSets paging size. (#3073)
without the paging parameter set, it will default to 100 records per request. with large enough zones and
potentially multiple coredns daemons configured to pull from route 53, this can quickly add up and reach
aws global api rate limits (5/sec per root account). increasing paging to max can help reduce the number
of requests needed to pull records for a zone without no down side that i am aware of.

this helps issue #2353, but probably is not a complete fix.

Signed-off-by: Matt Kulka <mkulka@parchment.com>
2019-07-31 12:09:10 -07: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
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
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
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
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
Mat Lowery
dae6aea292 Fix response_rcode_count_total metric (#3029) 2019-07-23 06:23:16 +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
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