Commit graph

1404 commits

Author SHA1 Message Date
Miek Gieben
cb932ca231
Better naming (#2104)
* Move functions from pkg/transport to pkg/parse

Although "parse" is a fairly generic name I believe this is somewhat
better named. pkg/transport keeps a few constants that are uses
throughout for the rest is is renaming a bunch (and the fallout from
there to make things compile again).

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

* Fix tests

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-19 08:16:04 +01:00
Miek Gieben
c349446a23
Cleanup ParseHostOrFile (#2100)
Create plugin/pkg/transport that holds the transport related functions.
This needed to be a new pkg to prevent cyclic import errors.

This cleans up a bunch of duplicated code in core/dnsserver that also
tried to parse a transport (now all done in transport.Parse).

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-09-19 07:29:37 +01:00
Chris O'Haver
2f1223c36a
Move suffix example out of EDNS0 section (#2102) 2018-09-17 16:41:38 -04:00
dilyevsky
153bd5f767
[plugin/route53]: Support batch mode operation. (#2050)
* [plugin/route53]: Support batch mode operation.

Cache all Route53 records internally using `ListResourceRecordPagesWithContext`
and serve them from memory.

Bonus features:

  * Support additional r53 record types (`CNAME`, `SOA`, etc)
  * Support `upstream` option (#2099 filed to support argument optionality)

Signed-off-by: Dmitry Ilyevskiy <dmitry.ilyevskiy@getcruise.com>
Signed-off-by: Dmitry Ilyevskiy <ilyevsky@gmail.com>
2018-09-17 11:19:07 -07:00
dilyevsky
4ac06a342b
[plugin/proxy]: Return on WriteMsg err. (#2096)
* [plugin/proxy]: Return on WriteMsg err.

Followup PR on the heels of #2050. Short-circut and log on error from
`WriteMsg`. This will prevent code getting stuck on `ReadMsg` and allow
for easier debugging.

Also simply the `ReadMsg` calling code a little - remove double `Close` (already called above).
2018-09-17 10:21:12 -07:00
dilyevsky
063999551d
Add @dilyevsky to reviewers. (#2094)
* Add @dilyevsky to reviewers.

Per @miekg suggestion on https://github.com/coredns/coredns/pull/2050#pullrequestreview-149538954
adding myself to OWNERS file.

* Also add me into plugin/route53-specific reviewers/approvers.
2018-09-13 15:22:57 -07:00
Chris O'Haver
0bf8b81cb7 plugin/federation: handle missing avail-zone/region labels better (#2092)
* handle missing avail-zone/region labels better

* oops forgot a file
2018-09-12 07:07:24 +01:00
Aaron Riekenberg
b42eae7a04 Add MINTTL parameter to cache configuration. (#2055)
* Add success min TTL parameter to cache.

* Add MINTTL to README.

* Update README.

* Add MINTTL to negative cache.

* Remove unnecessary variable name.

* Address review comments.

* Configure cache in TestCacheZeroTTL to have 0 min ttl.
2018-09-03 21:26:02 +02:00
Francois Tur
4c6c9d4b27 Move cache Keys to 64bit for a better dispersion and lower collision frequency (#2077)
* - change Key for cache to 64bits.

* - change Key for cache to 64bits.
2018-08-31 14:26:43 -07:00
Yong Tang
d00e8c3918 Update golang to 1.11 for README.md (#2076)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-08-31 19:39:55 +01:00
Miek Gieben
ad63cf0b4f
Document updates: (#2075)
Update the how to release notes in Makefile.release
And some little community tweaks in the README.md

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-31 19:28:33 +01:00
Miek Gieben
511a3bd252 release: kick travis to 1.11 (#2071)
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-30 08:29:03 -04:00
Paul G
38051b9089
plugin/rewrite: add handling of TTL field rewrites (#2048)
Resolves: #1981

Signed-off-by: Paul Greenberg <greenpau@outlook.com>
2018-08-29 10:41:03 -04:00
Miek Gieben
52147cd657
release: kill sum target (#2069)
Just create the sha256 inline so we know there are there.
Add a 'version' target in Makefile.release that prints the version so we
can double check that easily in the release script.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-29 15:17:32 +01:00
Miek Gieben
ba1efee4f1
Default to scrubbing replies in the server (#2012)
Every plugin needs to deal with EDNS0 and should call Scrub to make a
message fit the client's buffer. Move this functionality into the server
and wrapping the ResponseWriter into a ScrubWriter that handles these
bits for us. Result:

Less code and faster, because multiple chained plugins could all be
calling scrub and SizeAndDo - now there is just one place.

Most tests in file/* and dnssec/* needed adjusting because in those unit
tests you don't see OPT RRs anymore. The DNSSEC signer was also looking
at the returned OPT RR to see if it needed to sign - as those are now
added by the server (and thus later), this needed to change slightly.

Scrub itself still exist (for backward compat reasons), but has been
made a noop. Scrub has been renamed to scrub as it should not be used by
external plugins.

Fixes: #2010

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-29 12:26:22 +01:00
Miek Gieben
eb51e8bac9
Bump version to 1.2.2 (#2067)
* Bump version to 1.2.2

Release 1.2.2

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

* Fix filename to what we upload

With ls dir/* the pathname returned are diff. then we with ls dir, fix
how curl is called.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-29 07:51:45 +01:00
Chris O'Haver
684c35d56b lower cache min limit (#2065) 2018-08-29 07:13:18 +01:00
Miek Gieben
a21755479d release: split out sha256 upload (#2063)
For the 1.2.1 release we didn't upload the sha256 files. I've added
an echo, but some testing suggests that the files are created, so the
problem lays somewhere else.

Add a new upload section that sets the content type correctly and POST
the files as text/plain.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-28 13:58:35 -07:00
Miek Gieben
78a98ee0e2 release: echo assets (#2060)
help debug why the assets' sha256 files weren't upload to github.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-27 13:33:25 -07:00
Miek Gieben
554da015e7
release: up version to 1.2.1 (#2057)
up the version and add the man-pages.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-27 19:54:10 +01:00
Chris O'Haver
e6ef320d13 handle blank name and namespaces (#2042) 2018-08-27 19:41:04 +01:00
Chris O'Haver
444472891f
plugin/kubernetes: dont transfer unexposed namespaces (#2044)
dont transfer unexposed namespaces
2018-08-27 10:38:49 -04:00
Chris O'Haver
d60993e021
plugin/kubernetes: Create records for portless services (#2052)
inject sentinels for portless services
2018-08-27 10:10:51 -04:00
Bingshen Wang
75f1b9c988 fix kubernetes in-cluster CNAME lookup (#2040)
fix #2038

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
2018-08-25 08:53:41 -04:00
Chris O'Haver
610bdc091d
Add suffix example to docs (#2049) 2018-08-23 15:27:09 -04:00
Chris O'Haver
ed85986e70 plugin/kubernetes: Note that deprecated style pod records are not transferred (#2045)
* Update README.md

* Update README.md
2018-08-22 12:28:05 -07:00
Zach Eddy
8aa55c5ff2 Metrics listener fix (#2036)
* Create test to verify correct listener behavior

* Create Unset function to remove todo items

* Reset address for prometheus listener before restarting

* Add inline documentation for Unset function

* Make shutdownTimeout a constant and change to five seconds

* Revert ForEach behavior in uniq package
2018-08-21 11:52:25 -04:00
Eugen Kleiner
b87ed01bb2 plugin/forward: Split setup to reuse it from external plugins (#2034) 2018-08-15 14:24:47 -07:00
Francois Tur
81d0949159
updating Adopters list (#2033)
* - 12 more Adopters, extracted from the survey "CoreDNS Adoption"
2018-08-15 13:15:05 -04:00
Karsten Weiss
6d8a078704 Typo fixes (#2031) 2018-08-14 08:55:55 -07:00
Francois Tur
18a77cd045 - surver for "CoreDNS Adoption" is out since one week. on 3 of 15 replies, adopters provide their names and agree to be part of this list (#2025)
Automatically submitted.
2018-08-07 19:03:18 +00:00
Yong Tang
3ca25c1c64 Add exe extension to Windows release binary (#2022)
This fix adds exe extension to Windows release binary.

This fix fixes 2021.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-08-03 17:49:13 +01:00
Francois Tur
073708bc66 Invite users to fill the survey (#2020)
* - invite users to fill the survey

* Update README.md
2018-08-03 12:33:54 +01:00
varyoo
9cea32f013 dnstap.TapperFromContext always returns nil (#2018)
Automatically submitted.
2018-08-01 22:58:23 +00:00
Stanislav Zapolsky
2b4878195c fixed typo in kubernetes plugin man page and README. (#2014) 2018-07-30 07:37:24 -07:00
Miek Gieben
6e1c02c4ac Make presubmit actually fail the build (#2013)
The exit code wasn't properly acted upon in the makefile.
Make filename-hyphen actually return an non-zero exit code.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-29 23:41:52 -07:00
Yong Tang
54ec78c1ba Fix ineffassign (#1959)
* Fix ineffassign

This fix tries to fix ineffassign, as was reported in:
https://goreportcard.com/report/github.com/coredns/coredns#ineffassign

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

* Update setup.go

Revert this one change, so this can be merged.
2018-07-28 10:32:13 +01:00
Miek Gieben
62df253371
request: re-adjust size for edns0 RR (#2007)
* Add regression test for broken DNS truncation

With the latest changes to the implementation, request.Scrub() returns
invalid response messages which are larger than the advertised buffer
size. This commit adds a failing test for that.

* Add benchmark for response truncation

* request: re-adjust size for edns0 RR

Cherry-picked the test and benchmark commits from #1962 and make the
failing test not fail, by adding minimal fix in request.go.

This makes size 12 bytes smaller if we need to add back the OPT RR in
the message.

Closes: #1962

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

* Scrub: correctly check for EDNS0, not only Do

Make Scrub check for EDNS0, not only if the Do bit is set.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-28 10:27:38 +01:00
Miek Gieben
395be9adfc
Makefile: remove goimports (#2008)
This downloads gometalinter (which is now breaking in the CI tests).
Also the goimports target is run with ||true, so nothing will break
if this flags anything (done because of gofmt changes in between
release).

Probably I will setup something to use github's linter API:
https://github.com/markstory/lint-review

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-27 15:01:27 +01:00
Miek Gieben
bcf00be3fb
Add stickler config (#2009)
Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-27 15:00:49 +01:00
Chris O'Haver
992e7928c7 Document current limitations of loop (#1996)
* Document current limitations of loop

* Update README.md
2018-07-23 20:37:41 +01:00
Miek Gieben
b7ae8d4e86
plugin/loop: add missing break (#1992)
The Onstartup loop wouldn't call break after the first success, thereby
sending the query multiple times and halting the process.

Some small other optimizations as well.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-22 11:54:02 +01:00
Lorenzo Fontana
170e1d6b66 Test cases for address normalization with specified protocols (#1993)
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2018-07-21 18:06:13 +01:00
Miek Gieben
aba0b4e122 release: add sha256sum files (#1991)
Generate the sha256 sum of each asset. These should all be automatically
be uploaded in the github-push target.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-21 08:39:53 -07:00
Miek Gieben
84ec780ffc
New plugin: loop (#1989)
* New plugin: loop

Add a plugin that detects loops. It does this by sending an unique query
to our selves. If we see the query more than twice we stop the process.
If there isn't a loop, the plugin disables it self and becomes a noop
plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-20 19:45:17 +01:00
Miek Gieben
547f155465
Logfatalf (#1990)
* bliep

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

* plugin/log: add log.Fatal[f]

Add log.Fatal(f) to mimic more of the log package. The first and only
use is in the (new) loop plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-20 15:08:06 +01:00
Miek Gieben
d998aa6c25
plugin/erratic: add axfr support (#1977)
* plugin/erratic: add axfr support

Add support for axfr. This to fix and test long standing axfr issues
that are hard to test if we don't support it directly in coredns.

The most intriguing feature is withholding the last SOA from a response
so the client needs to wait; drop (no reply) and delay is also
supported. All TTLs are set to zero.

Add simple tests that checks if first record is a SOA.

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

* more test coverage

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-20 10:25:54 +01:00
Miek Gieben
f3134da45e
Clean up tests logging (#1979)
* Clean up tests logging

This cleans up the travis logs so you can see the failures better.

Older tests in tests/ would call log.SetOutput(ioutil.Discard) in
a haphazard way. This add log.Discard and put an `init` function in each
package's dir (no way to do this globally). The cleanup in tests/ is
clear.

All plugins also got this init function to have some uniformity and kill
any (future) logging there in the tests as well.

There is a one-off in pkg/healthcheck because that does log.

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

* bring back original log_test.go

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

* suppress logging here as well

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-19 16:23:06 +01:00
Miek Gieben
c69bed726b plugin/hosts: add log.Debug (#1985)
Logs the amount of entries we parsed after every parse, but only when
debug is loaded.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-19 07:16:35 -07:00
Jiacheng Xu
6621931620 plugin/etcd: Add SRV and TXT examples. (#1980) 2018-07-19 07:33:31 +01:00