Commit graph

1814 commits

Author SHA1 Message Date
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
Anshul Sharma
f9fb9db171 ISSUE-2911 (#2923)
- Remove resyncperiod from Kubernetes plugin
2019-07-03 20:39:12 +01:00
Anshul Sharma
2bd77d0823 Fix multiple credentials in route53 (#2859) 2019-07-03 20:14:31 +01:00
Miek Gieben
f5fe98395e
Remove -cpu flag (#2793)
The -cpu flag is a weird one (and copied originally from Caddy), it
basically sets GOMAXPROCS which can be *easily* done by just setting
that environment variable. Also with systemd and containerized env you
set this externally *anyway*, so there is little use to do this again in
the binary.

Also the option's help was confusing (i.e. percentage of what?). Remove
the option and supporting files.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-03 20:12:51 +01:00
Miek Gieben
e0c373ec12
notes 1.5.2: fix typo (#2971)
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-03 20:09:56 +01:00
Miek Gieben
d933f635af
Bump version to 1.5.2 (#2969)
Run through the motions; create manual pages. Run go generate for good
measure. Fix typo in Makefile.release while at it.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-03 19:47:38 +01:00
Miek Gieben
bb9df3122d
Update notes and make the manual pages (#2970)
* Update notes and make the manual pages

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

* better

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-03 19:38:19 +01:00
John Belamaric
7cf73cc01d
plugin/template: support metadata (#2958)
* Enable use of metadata in templates

* Update README

* Don't stash away ctx, instead use a new func
2019-07-03 16:10:56 +01:00
Miek Gieben
2faad5b397 Release: 1.5.2, add release notes (#2965)
Prompted by the caddy import path changes; prepare a new release.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-03 15:32:24 +08:00
Miek Gieben
3e5fd21e68
file: close correctlty after AXFR (#2943)
* file: close correctlty after AXFR

Don't hijack, but wait for the writes to be done and then savely close
the connection.

Fixes: #2929

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

* Update comment

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

* file: close correctlty after AXFR (#2943)

apply

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-03 07:01:57 +01:00
Yong Tang
f8bba51f84
Update Caddy to 1.0.1, and update import path (#2961)
* Update Caddy to 1.0.1, and update import path

This fix updates caddy to 1.0.1 and also
updates the import path to github.com/caddyserver/caddy

This fix fixes 2959

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

* Also update plugin.cfg

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

* Update and bump zplugin.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-03 09:04:47 +08:00
Miek Gieben
22c6e3e179
plugins: set upstream unconditionally (#2956)
`upstream` is not needed as a setting; just set if unconditionally and
remove all documentation and tests for it.

At some point we want remove the hanlding for `upstream` as well and
error out on seeing it.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-02 16:23:47 +01:00
Miek Gieben
3a0c7c6153 plugin/file: load secondary zones lazily on startup (#2944)
This fixes a long standing bug:
fixes: #1609

Load secondary zones in a go-routine; this required another mutex to
protect some fields; I think those were needded anyway because a
transfer can also happen when we're running; we just didn't have a test
for that situation.

The test had to be changed to wait for the transfer to happen at this is
async now.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-30 05:22:34 +08:00
JINMEI Tatuya
2c1f5009be added a test for transferring a large zone in file plugin (#2905)
* added a test for transferring a large zone in file plugin

* avoid hardcoding number of RRs multiple times

* don't do testing.Parallel as suggested.

* applied gofmt -s
2019-06-29 08:58:07 +01:00
bcebere
6e7a5f5677 TLS hardening (#2938)
Automatically submitted.
2019-06-28 11:03:34 +00:00
Timoses
41661b0848 Provide example to utilize k8s_external plugin (#2936)
* Provide example to utilize k8s_external plugin

The example provides a specific use case of k8s_external and may help others to grasp `k8s_external`'s capabilities.

* Update plugin/k8s_external/README.md

Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>

* Update plugin/k8s_external/README.md

Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>
2019-06-27 20:02:08 +01:00
Miek Gieben
c9e3613613
Notes for 1.5.1. (#2928)
Fighting with hugo - dates can't be quoted.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-26 14:08:35 +01:00
Miek Gieben
6c33397d29
Tag 1.5.1 (#2927)
Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-26 12:46:34 +01:00
Miek Gieben
d4d019d749
docs: Makefile.release and Makefile.doc (#2926)
* add metrics for reload
* documented release process better
* run: Makefile.doc all to push reload doc to man-pages

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-26 11:18:03 +01:00
Anshul Sharma
ad352cee88 plugin/reload: Add metrics (#2922)
* Issue 2920
- Add failed reload counter metrics

* typo fix

* Requested Changes
2019-06-26 07:38:46 +01:00
Miek Gieben
cd176f859b Run gofmt -s and golint on the codebase (#2918)
* Run gofmt -s and golint on the codebase

Run golint and fix everythign it flagged (except the context arg
ordering), mostly edits in the rewrite plugin.

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

* ... and ofcourse the test as well

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-25 15:00:33 +08:00
Yong Tang
123628dc46 Update zipkin, etcd, klog and aws (#2913)
* Update zipkin, etcd, klog and aws

This fix updates:
- github.com/openzipkin/zipkin-go-opentracing
- k8s.io/klog
- github.com/coreos/etcd
- github.com/aws/aws-sdk-go

This fix fixes #2906
This fix fixes #2907
This fix fixes #2908
This fix fixes #2909

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

* Also updates opentracing

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-06-25 07:49:51 +01:00
Miek Gieben
242ed71845
Add 1.5.1 release notes (#2912)
* Add 1.5.1 release notes

Prepare for imminent release.
Also list PRs merged in a new section to provide more detail.

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

* Updates after review

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-25 07:42:59 +01:00
Miek Gieben
51cf388da2 doc: make -f Makefile.doc (#2919)
mechanical change: create the manual pages.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-24 19:37:27 +08:00
Yong Tang
e54b784a7e Update multiple dependencies (#2904)
This fix updates:
- github.com/miekg/dns from 1.1.12 to 1.1.14
- google.golang.org/grpc from 1.21.0 to 1.21.1
- github.com/aws/aws-sdk-go from 1.19.41 to 1.20.3
- github.com/prometheus/common from 0.4.1 to 0.6.0
- gopkg.in/DataDog/dd-trace-go.v1 from 1.14.0 to 1.15.0

This fix fixes #2899
This fix fixes #2900
This fix fixes #2901
This fix fixes #2902
This fix fixes #2903

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-06-20 10:46:16 +01:00
Chris O'Haver
b94c85a0db Update README.md (#2896) 2019-06-17 20:46:02 +01:00
Chris O'Haver
1cb44f0bfd Update plugin.go (#2894) 2019-06-17 20:01:06 +01:00
Miek Gieben
8848792e40
plugin/file: document using an explicit origin (#2893)
* plugin/file: document using an explicit origin

See #2880

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

* Code review comments

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-17 19:47:07 +01:00
Sandeep Rajan
ade5ea2361 Add CircleCI for Integration testing (#2889)
* add circleci

* make ci work

* use existing script for setup

* add sep step for getting CI repo
2019-06-17 19:26:42 +01:00
An Xiao
c432f894b2 Rename bind_test.go to setup_test.go (#2891)
Signed-off-by: Xiao An <hac@zju.edu.cn>
2019-06-17 13:20:33 +01:00
An Xiao
c1d7c2e69b Raise error if regexp and template are not specified together (#2884)
Signed-off-by: Xiao An <hac@zju.edu.cn>
2019-06-13 12:07:41 +01:00