* 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>
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>
* [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>
* [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).
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>
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>
* 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>
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>
* 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
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>
* 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>
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>
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>
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>
* 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>
* 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>
* 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>
* 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>