Commit graph

103 commits

Author SHA1 Message Date
Marius Kimmina
92ec849acb
plugin/tls: respect the path specified by root plugin (#6138)
* plugin/tls: respect the path specified by root plugin

Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com>

* improve readme

Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com>

---------

Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com>
2023-12-08 10:50:30 -05:00
journey-c
7765aa87a4
plugin/etcd: the etcd client adds the DialKeepAliveTime parameter (#6351) 2023-11-10 14:17:55 -08:00
Chris O'Haver
d3965b8b60
Revert "plugin/tls: respect the path specified by root plugin (#5944)" (#6136)
This reverts commit d0375bc026.
2023-06-01 14:07:58 -04:00
Marius Kimmina
d0375bc026
plugin/tls: respect the path specified by root plugin (#5944)
Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com>
2023-06-01 08:56:57 -04:00
Vico Chu
cbbe9da890
plugin/etcd: update documentation (#5847)
Signed-off-by: Vico Chu <vico24826@gmail.com>

Signed-off-by: Vico Chu <vico24826@gmail.com>
2023-01-11 08:31:46 -05:00
Ondřej Benkovský
c2dbb7141a
add golangci-lint linter (#5499) 2022-07-10 11:06:33 -07:00
Chris O'Haver
4d76faa4b4
plugin/etcd: Fix multi record TXT lookups (#5293)
* fix multi-record txt

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-04-04 14:59:16 -04:00
Qasim Sarfraz
74b84a1377
update all +build statements (#5271)
* update all +build statements

Signed-off-by: MQasimSarfraz <syed.qasim.sarfraz@gmail.com>

* remove old +build style

Signed-off-by: MQasimSarfraz <syed.qasim.sarfraz@gmail.com>
2022-03-18 07:11:14 -07:00
Chris O'Haver
66dc74caeb
plugin/etcd+kubernetes: Persist truncated state to client if CNAME lookup response is truncated (#4715)
Persist the TC bit to client response for truncated CNAME lookups.
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-02-22 09:38:57 -05:00
soulfy
49ee97994e
fix: convert key to domain (#5064)
fix convert key to domain when key ends with '/'
2022-02-01 09:45:43 -05:00
Miek Gieben
5f41d8eb1f
reverse zone: fix Normalize (#4621)
Make normalize return multiple "hosts" (= reverse zones) when a
non-octet boundary cidr is given.

Added pkg/cidr package that holds the cidr calculation routines; felt
they didn't really fit dnsutil.

This change means the IPNet return parameter isn't needed, the hosts are
all correct. The tests that tests this is also removed: TestSplitHostPortReverse
The fallout was that zoneAddr _also_ doesn't need the IPNet member, that
in turn make it visible that zoneAddr in address.go duplicated a bunch
of stuff from register.go; removed/refactored that too.

Created a plugin.OriginsFromArgsOrServerBlock to help plugins do the
right things, by consuming ZONE arguments; this now expands reverse
zones correctly. This is mostly mechanical.

Remove the reverse test in plugin/kubernetes which is a copy-paste from
a core test (which has since been fixed).

Remove MustNormalize as it has no plugin users.

This change is not backwards compatible to plugins that have a ZONE
argument that they parse in the setup util.

All in-tree plugins have been updated.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-05-17 13:19:54 -07:00
Jason Du
d1f520a5b2
Fix etcd to use v3.5.0-alpha.0 (#4628)
Signed-off-by: Jason Du <xdu@infoblox.com>
2021-05-14 23:55:01 -07:00
ntoofu
696c8731d6
plugin/etcd: Fix inconsistent names of glue records with TargetStrip (#4595)
* etcd plugin: Add testcases for `TargetStrip` feature

Signed-off-by: ntoofu <ntoofu@users.noreply.github.com>

* etcd plugin: Fix inconsistent names in glue records

Signed-off-by: ntoofu <ntoofu@users.noreply.github.com>
2021-05-03 08:48:51 -07:00
Miek Gieben
9178f9d1ee
Remove newlines between braces (#4279)
These are found with: `pcregrep -M "}\n\n}" **/*.go`
Sometimes a unneeded newline is inserted, remove those.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-11 18:45:01 +01:00
Miek Gieben
c2e4f2f1ab
docs: move Also See to See Also (#4245)
sed -i 's/Also See/See Also/' plugin/**/README.md

Some plugins did already use 'See Also', so it's all consistent now.

Fixes: #4196

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-10-28 10:56:35 -07:00
Yong Tang
9798dd067f
Cherry-pick: Implement notifies for transfer plugin (#3972) (#4142)
* Implement notifies for transfer plugin (#3972)

* Fix notifies in transfer plugin

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

* Make it compile

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

* Port more plugins

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

* golint

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

* Fix tests

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

* Fix notifies in transfer plugin

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

* Make it compile

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

* Port more plugins

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

* golint

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

* Fix tests

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

* Fix tests

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

* really fix test

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

* Implement ixfr fallback and unify file and auto for transfering

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

* Add transfer tests

copied and modified from #3452

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

* Test correct selection of plugin

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

* add upstream back in

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

* Implement ixfr fallback and unify file and auto for transfering

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

* fix test

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

* properly merge

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

* Remove plugin/kubernetes/setup_transfer_test.go

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

Co-authored-by: Miek Gieben <miek@miek.nl>
2020-09-24 20:30:39 +02:00
Miek Gieben
b003d06003
For caddy v1 in our org (#4018)
* For caddy v1 in our org

This RP changes all imports for caddyserver/caddy to coredns/caddy. This
is the v1 code of caddy.

For the coredns/caddy repo the following changes have been made:

* anything not needed by us is deleted
* all `telemetry` stuff is deleted
* all its import paths are also changed to point to coredns/caddy
* the v1 branch has been moved to the master branch
* a v1.1.0 tag has been added to signal the latest release

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

* Fix imports

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

* Group coredns/caddy with out plugins

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

* remove this file

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

* Relax import ordering

github.com/coredns is now also a coredns dep, this makes
github.com/coredns/caddy fit more natural in the list.

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

* Fix final import

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-09-24 18:14:41 +02:00
Miek Gieben
b9a6dba2cb
plugin/etcd: update documention (#4049)
* plugin/etcd: update documention

Make clear(er) how this plugin find records.

Fixes: #4048

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

* Update plugin/etcd/README.md

Co-authored-by: Chris O'Haver <cohaver@infoblox.com>

* Update plugin/etcd/README.md

Co-authored-by: Chris O'Haver <cohaver@infoblox.com>

Co-authored-by: Chris O'Haver <cohaver@infoblox.com>
2020-08-10 15:20:01 +02:00
Yong Tang
614d08cba2
Revert "Implement notifies for transfer plugin (#3972)" (#3995)
This reverts commit 68f1dd5ddf.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2020-07-08 09:00:26 -07:00
Miek Gieben
68f1dd5ddf
Implement notifies for transfer plugin (#3972)
* Fix notifies in transfer plugin

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

* Make it compile

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

* Port more plugins

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

* golint

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

* Fix tests

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

* Fix notifies in transfer plugin

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

* Make it compile

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

* Port more plugins

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

* golint

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

* Fix tests

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

* Fix tests

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

* really fix test

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

* Implement ixfr fallback and unify file and auto for transfering

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

* Add transfer tests

copied and modified from #3452

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

* Test correct selection of plugin

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

* add upstream back in

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

* Implement ixfr fallback and unify file and auto for transfering

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

* fix test

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

* properly merge

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-07-07 12:38:07 -07:00
Mirek S
8fe950f4bc
Fix to: (#3840)
https://github.com/coredns/coredns/issues/3810

Signed-off-by: msedzins <msedzins@gmail.com>
Signed-off-by: msedzins <macbookpro@mbp-macbookpro-2.home>

Co-authored-by: msedzins <macbookpro@mbp-macbookpro-2.home>
2020-04-22 14:55:07 +02:00
Miek Gieben
995179a6c6
presubmit: check import path ordering (#3636)
Add a test for this as well as it's annoying to point out in every code
review.
Fix all the import paths that are flagged by this new test.

Fixes: #3634

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-01-30 09:19:26 +00:00
Miek Gieben
5f159ca464 gofmt -w -s **/*.go (#3603)
format and remove trailing white space; makes 'make presubmit' pass
again.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-01-17 10:47:45 -05:00
Jonathan Nagy
e3266d24f7 Resolve TXT records via CNAME (#3557)
* Add test case for TXT lookup via CNAME

Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com>

* Return HostType of explicit TXT records

Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com>

* Adapt TXT method lookup to allow lookup via CNAME

Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com>

* Implement lookup of TXT records via CNAME

Signed-off-by: Jonathan Nagy <nagytech@users.noreply.github.com>
2020-01-03 14:16:04 +01:00
Miek Gieben
24176a97e6
Move to CODEOWNERS (#3489)
* Move to CODEOWNERS

No change in who own what; just a move to CODEOWNERS. This allows
dreck cleanups.

Added .dreck.yaml for alias and exec.

Fixes: #3486

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

* stickler bot

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

* sort the file

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-11-29 13:17:05 +00:00
Miek Gieben
dbd1c047cb
Run gostaticheck (#3325)
* Run gostaticheck

Run gostaticcheck on the codebase and fix almost all flagged items.

Only keep

* coremain/run.go:192:2: var appVersion is unused (U1000)
* plugin/chaos/setup.go:54:3: the surrounding loop is unconditionally terminated (SA4004)
* plugin/etcd/setup.go:103:3: the surrounding loop is unconditionally terminated (SA4004)
* plugin/pkg/replacer/replacer.go:274:13: argument should be pointer-like to avoid allocations (SA6002)
* plugin/route53/setup.go:124:28: session.New is deprecated: Use NewSession functions to create sessions instead. NewSession has the same functionality as New except an error can be returned when the func is called instead of waiting to receive an error until a request is made.  (SA1019)
* test/grpc_test.go:25:69: grpc.WithTimeout is deprecated: use DialContext and context.WithTimeout instead.  Will be supported throughout 1.x.  (SA1019)

The first one isn't true, as this is set via ldflags. The rest is
minor. The deprecation should be fixed at some point; I'll file some
issues.

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

* Make sure to plug in the plugins

import the plugins, that file that did this was removed, put it in the
reload test as this requires an almost complete coredns server.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-01 07:41:29 +01:00
Guangming Wang
eb59e79207 plugin: cleanup code based on staticcheck warnings (#3302)
TrimPrefix re-assign to former variable

Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-09-25 13:23:43 +01:00
Miek Gieben
004c5fca9d
all: simply registering plugins (#3287)
Abstract the caddy call and make it simpler.

See #3261 for some part of the discussion.

Go from:

~~~ go
func init() {
       caddy.RegisterPlugin("any", caddy.Plugin{
               ServerType: "dns",
               Action:     setup,
       })
}
~~~

To:

~~~ go
func init() { plugin.Register("any", setup) }
~~~

This requires some external documents in coredns.io to be updated as
well; the old way still works, so it's backwards compatible.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-09-20 08:02:30 +01:00
Miek Gieben
62317c3c14 update doc to not use the root zone for everything (#3288)
Update all documentation in the tree to use example.org as an example
configuration (in so far possible). As to get out of the just use "."
and fallthrough and things would be fine.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-09-19 06:17:53 -07:00
Cricket Liu
5339949596 Making README consistent with other plugins' READMEs (#3249) 2019-09-08 08:25:26 +01:00
Miek Gieben
2cb017928c
plugin/etcd: clarify it's not a generic backend (#3220)
* plugin/etcd: clarify it's not a generic backend

Clarify the docs that this is not a generic backend.

Wrap it on 80 columns as well.

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

* Update plugin/etcd/README.md

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

* Update plugin/etcd/README.md

Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>
2019-08-28 14:59:00 +01:00
Miek Gieben
efcc3758dd
plugin/etcd: fully move to go.etcd.io (#3215)
This is needed as well to make it compile cleanly. Follow up to #3214.

Manually removed github.com/coreos/etcd/ from go.mod

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-08-27 16:58:35 +01:00
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
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
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
Christian Muehlhaeuser
c928dbd754 Added comment why ominous assignment is required (#3021) 2019-07-19 06:31:29 +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
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
be1ac9fed4
plugins: remove upstream [ADDRESS] from docs (#2772)
Various plugins still had this documented, the setup functions still
allow it (which is fine), but update the docs that this arguments isn't
there any more.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-08 16:45:29 +01:00
Miek Gieben
53f3f0b666
Remove context.Context from request.Request (#2726)
* Remove context.Context from request.Request

This removes the context from request.Request and makes all the changes
in the code to make it compile again. It's all mechanical. It did
unearth some weirdness in that the context was kept in handler structs
which may cause havoc with concurrently handling of requests.

Fixes #2721

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

* Make test compile

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-26 14:37:30 +00:00
MengZeLee
4405661520 patch setup (#2675)
* patch setup

Use a more streamlined grammar

* fix break

No need to break out in this for loop
2019-03-18 07:17:46 +00:00
Miek Gieben
5cff7d5790
Remove etcd unit testing from travis (#2672)
* Remove etcd unit testing from travis

Remove these from the travis unit testing. (to speed up travis)

See #2671

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

* Add build tag

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-13 07:33:38 +00:00
Yong Tang
9dd288943a Move *proxy* to external (#2651)
* Move *proxy* to external

move the proxy plugin into coredns/proxy and remove it as a default
plugin. Link the proxy to deprecated in plugin.cfg

coredns/proxy doesn't compile because of the vendoring :(

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

* Add github.com/coredns/proxy

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-03-04 07:32:38 +00:00
Nguyen Quang Huy
42cf6606fc Fix error string should not be capitalized (#2608)
From [Golang coding convention](https://github.com/golang/go/wiki/CodeReviewComments#error-strings)

Co-Authored-By: Nguyen Van Trung [trungnvfet@outlook.com](mailto:trungnvfet@outlook.com)
Signed-off-by: Nguyen Quang Huy [huynq0911@gmail.com](mailto:huynq0911@gmail.com)
2019-02-27 08:25:02 -05:00
Xiao An
05c0f7161b Fix some typos in documents (#2592)
Signed-off-by: Xiao An <hac@zju.edu.cn>
2019-02-21 07:15:17 +00:00
Sandeep Rajan
d42d80c4f6 cleanup by fmt and remove redundant type declarations (#2563) 2019-02-17 08:32:28 +00:00
Nguyen Quang Huy
8d09cb243f Fix some typos (#2560)
* Fix some typos

Corect some words for reading more easily

* Update NOERROR response code

NOERROR is a response code so I revert the typo checking for it
2019-02-17 08:31:12 +00:00
JoeWrightss
f69819387d Fix t.Error error message (#2551)
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-11 07:23:05 +00:00
JoeWrightss
06d945fc32 Fix some spelling errors in comment (#2533)
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-07 11:27:27 -05:00