aboutsummaryrefslogtreecommitdiff
path: root/plugin/etcd (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-05-17reverse zone: fix Normalize (#4621)Gravatar Miek Gieben 1-9/+1
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-14Fix etcd to use v3.5.0-alpha.0 (#4628)Gravatar Jason Du 2-3/+3
Signed-off-by: Jason Du <xdu@infoblox.com>
2021-05-03plugin/etcd: Fix inconsistent names of glue records with TargetStrip (#4595)Gravatar ntoofu 1-0/+17
* 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>
2020-11-11Remove newlines between braces (#4279)Gravatar Miek Gieben 1-1/+0
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-10-28docs: move Also See to See Also (#4245)Gravatar Miek Gieben 1-1/+1
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-09-24Cherry-pick: Implement notifies for transfer plugin (#3972) (#4142)Gravatar Yong Tang 1-10/+2
* 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-24For caddy v1 in our org (#4018)Gravatar Miek Gieben 2-2/+2
* 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-08-10plugin/etcd: update documention (#4049)Gravatar Miek Gieben 1-7/+13
* 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-07-08Revert "Implement notifies for transfer plugin (#3972)" (#3995)Gravatar Yong Tang 1-2/+10
This reverts commit 68f1dd5ddf0451cc3a1b24a72c2965b8d896ffba. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2020-07-07Implement notifies for transfer plugin (#3972)Gravatar Miek Gieben 1-10/+2
* 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-04-22Fix to: (#3840)Gravatar Mirek S 1-2/+2
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-01-30presubmit: check import path ordering (#3636)Gravatar Miek Gieben 1-1/+1
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-17gofmt -w -s **/*.go (#3603)Gravatar Miek Gieben 1-1/+1
format and remove trailing white space; makes 'make presubmit' pass again. Signed-off-by: Miek Gieben <miek@miek.nl>
2020-01-03Resolve TXT records via CNAME (#3557)Gravatar Jonathan Nagy 4-8/+22
* 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>
2019-11-29Move to CODEOWNERS (#3489)Gravatar Miek Gieben 1-6/+0
* 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-10-01Run gostaticheck (#3325)Gravatar Miek Gieben 1-3/+0
* 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-09-25plugin: cleanup code based on staticcheck warnings (#3302)Gravatar Guangming Wang 1-1/+1
TrimPrefix re-assign to former variable Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-09-20all: simply registering plugins (#3287)Gravatar Miek Gieben 1-6/+1
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-19update doc to not use the root zone for everything (#3288)Gravatar Miek Gieben 1-6/+14
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-08Making README consistent with other plugins' READMEs (#3249)Gravatar Cricket Liu 1-2/+2
2019-08-28plugin/etcd: clarify it's not a generic backend (#3220)Gravatar Miek Gieben 1-16/+31
* 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-27plugin/etcd: fully move to go.etcd.io (#3215)Gravatar Miek Gieben 2-3/+3
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-24go report card fixes (#3182)Gravatar Miek Gieben 1-9/+0
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-22Cleanup: fix some typos in code comment (#3172)Gravatar Guangming Wang 1-1/+1
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-07-29cleanup: error message typos in setup_test.go (#3065)Gravatar dzzg 1-2/+2
Signed-off-by: zhengguang zhu <zhengguang.zhu@daocloud.io>
2019-07-19Added comment why ominous assignment is required (#3021)Gravatar Christian Muehlhaeuser 1-0/+1
2019-07-04gofmt fix for `No newline at end of file` (#2973)Gravatar Yong Tang 1-1/+1
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-03Update Caddy to 1.0.1, and update import path (#2961)Gravatar Yong Tang 2-2/+2
* 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-02plugins: set upstream unconditionally (#2956)Gravatar Miek Gieben 3-23/+5
`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-04-08plugins: remove `upstream [ADDRESS]` from docs (#2772)Gravatar Miek Gieben 1-4/+2
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-03-26Remove context.Context from request.Request (#2726)Gravatar Miek Gieben 4-31/+25
* 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-18patch setup (#2675)Gravatar MengZeLee 1-47/+40
* patch setup Use a more streamlined grammar * fix break No need to break out in this for loop
2019-03-13Remove etcd unit testing from travis (#2672)Gravatar Miek Gieben 1-1/+2
* 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-04Move *proxy* to external (#2651)Gravatar Yong Tang 2-6/+4
* 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-02-27Fix error string should not be capitalized (#2608)Gravatar Nguyen Quang Huy 1-1/+1
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-21Fix some typos in documents (#2592)Gravatar Xiao An 1-3/+3
Signed-off-by: Xiao An <hac@zju.edu.cn>
2019-02-17cleanup by fmt and remove redundant type declarations (#2563)Gravatar Sandeep Rajan 1-1/+1
2019-02-17Fix some typos (#2560)Gravatar Nguyen Quang Huy 1-1/+1
* 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-11Fix t.Error error message (#2551)Gravatar JoeWrightss 1-1/+1
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-07Fix some spelling errors in comment (#2533)Gravatar JoeWrightss 1-1/+1
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-01support etcd credentials in etcd plugin (#2442)Gravatar Christophe de Carvalho 4-14/+74
* support etcd credentials in etcd plugin fixes #2441 * try to fix cleanup of authentication
2019-01-28plugin/etcd: Filter empty host field by qtype (#2499)Gravatar Carl-Magnus Björkell 3-3/+33
When a query, different from a TXT lookup is performed, all services with a missing `Host` field should be filtered out, as these otherwize cause a line in the answer section with a single dot (`.`) as the result. This behavior manifests for example when a TXT record is present on a domain, eg. an A or SRV lookup is performed on said domain. If there are no services containing a `Host` field, a `NODATA` response should be given. If there are other Services, these alone should be returned for the query. Filter any service that has an empty Host field from all lookup types other than TXT to solve this issue. At the same time the check for empty `Text` fields in TXT queries are also moved to the same check in the etcd ServiceBackend.
2019-01-27plugin/etcd: Fix REAME's ttl (#2502)Gravatar mrasu 1-4/+4
There are string ttls at commands at README.md. But because `TTL` of `Service` is uint32, commands at README is wrong. e.g.) `etcdctl put /skydns/local/skydns/x1 '{"host":"1.1.1.1","ttl":"60"}'`.
2019-01-27plugin/etcd: Remove unnecessary struct copy (#2497)Gravatar Carl-Magnus Björkell 1-4/+3
The `b` struct is just copying all the fields into a new one, to check if it already existed in a set. This isn't needed as all the fields are identical, and a small rearrangement of the code solves the same problem without the copy.
2019-01-19Stop importing testing in the main binary (#2479)Gravatar Miek Gieben 5-16/+24
* Stop importing testing in the main binary Stop importing "testing" into the main binary: * test/helpers.go imported it; remote that and change function signature * update all tests that use this Signed-off-by: Miek Gieben <miek@miek.nl> * Drop import testing from metrics plugin Signed-off-by: Miek Gieben <miek@miek.nl> * more fiddling Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-13Default to upstream to self (#2436)Gravatar Miek Gieben 9-312/+21
* Default to upstream to self This is a backwards incompatible change. This is a massive (cleanup) PR where we default to resolving external names by the coredns process itself, instead of directly forwarding them to some upstream. This ignores any arguments `upstream` may have had and makes it depend on proxy/forward configuration in the Corefile. This allows resolved upstream names to be cached and we have better healthchecking of the upstreams. It also means there is only one way to resolve names, by either using the proxy or forward plugin. The proxy/forward lookup.go functions have been removed. This also lessen the dependency on proxy, meaning deprecating proxy will become easier. Some tests have been removed as well, or moved to the top-level test directory as they now require a full coredns process instead of just the plugin. For the etcd plugin, the entire StubZone resolving is *dropped*! This was a hacky (but working) solution to say the least. If someone cares deeply it can be brought back (maybe)? The pkg/upstream is now very small and almost does nothing. Also the New() function was changed to return a pointer to upstream.Upstream. It also returns only one parameter, so any stragglers using it will encounter a compile error. All documentation has been adapted. This affected the following plugins: * etcd * file * auto * secondary * federation * template * route53 A followup PR will make any upstream directives with arguments an error, right now they are ignored. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix etcd build - probably still fails unit test Signed-off-by: Miek Gieben <miek@miek.nl> * Slightly smarter lookup check in upstream Signed-off-by: Miek Gieben <miek@miek.nl> * Compilez Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-30disable ra flag for several plugins (#2408)Gravatar Isolus 2-2/+1
* disable ra flag for several plugins * removed unnecessary assignment * removed more unnecessary assignments
2018-12-08Convert bool map to struct{} map in etcd.go (#2381)Gravatar Yong Tang 1-2/+2
This fix converts bool map to struct{} map in etcd.go (there might be several other places). Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-12-07msg.Service: optimize a bit (#2374)Gravatar Miek Gieben 2-8/+21
Make the NewSRV and friends slightly smarter. Optimize the calling of targetStrip which is almost certainly not used. Added benchmark show a modest improvement: benchmark old ns/op new ns/op delta BenchmarkNewSRV-4 300 283 -5.67% Signed-off-by: Miek Gieben <miek@miek.nl>
2018-11-16Set SOA record TTL as min of TTL/MINIMUM (#2295)Gravatar stuart nelson 2-10/+10
* Set SOA record TTL as min of TTL/MINIMUM According to https://tools.ietf.org/html/rfc2308#section-3: The TTL of this record is set from the minimum of the MINIMUM field of the SOA record and the TTL of the SOA itself, and indicates how long a resolver may cache the negative answer. Set the TTL accordingly so as to not always negative cache SOA records for 300 seconds. * Inline min func * Update SOA record tests * Fix types