Currently, when you run `TestEtcdCredentials` at etcd_credentials_test.go multiple times without clearing data of etcd, you will get following errors.
```
etcd_credentials_test.go:38: Failed to create root role: etcdserver: role name already exists
etcd_credentials_test.go:41: Failed to create user: etcdserver: user name already exists
```
symlink from within .github
This should be enough to show it in pull request; unless github has
something against symlinks.
Signed-off-by: Miek Gieben <miek@miek.nl>
* doc: update CONTRIBUTING.md
Remove bunch of old/stale text, but add a section (and clarify) using
issues to describe a future PR and that those need to be small (if you
want it merged faster)
Signed-off-by: Miek Gieben <miek@miek.nl>
* Update CONTRIBUTING.md
Co-Authored-By: miekg <miek@miek.nl>
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.
* readme: add text on backward incompat changes
Document the process of releasing backwards incompatible changes.
Signed-off-by: Miek Gieben <miek@miek.nl>
* slightly better
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add an example
Signed-off-by: Miek Gieben <miek@miek.nl>
* Be more explicit in naming the segments increased
Signed-off-by: Miek Gieben <miek@miek.nl>
This PR is a small golint fix:
```
coredns/plugin/test/helpers.go
Line 283: warning: redundant if ...; err != nil check, just return error instead. (golint)
```
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
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"}'`.
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.
The check is done through
```
if [[ $(go list -f '{{ join .Deps " "}}') == *" testing "* ]]; then
error..
fi
```
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* 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>
This fix deprecates endpoints for out-of-cluster k8s api,
The Corefile still takes multiple endpoints though only
the first one is used. A warning is shown if there are
multiple endpoints.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* 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>
* Remove version pinning of thrift, ugoriji/go, and etcd
For incompatibility reasons at one point, we were forced
to pining the version of thrift, ugoriji/go, and etcd
to very specific versions (some are not versioned commits)
to get around the build issues.
It looks like those incompatibility issues are gone so
we could remove the pinning of thrift, ugoriji/go, and etcd.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update Gopkg.lock
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update vendor library
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This fix will error out when multiple https endpoints are specified,
as additional work is needed to support beyond http.
This fix fixes 1464.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Almost 100% mechanical change, except the fact that import/import.md
is moved to import/README.md
No content changes.
Signed-off-by: Miek Gieben <miek@miek.nl>
* wip: add import to make it have docs
Fake the import plugin further to give it proper docs. This should help
make it more discoverable.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Finish writing the documentation
Signed-off-by: Miek Gieben <miek@miek.nl>
Add words in object.go on the memory use and put some future ideas in
there to use even less (if we have to at some point).
Signed-off-by: Miek Gieben <miek@miek.nl>
* plugin/log: update nodata/NXDOMAIN story a bit
Add more words on nodata and NXDOMAIN which is a confusing DNS
"feature"
Fixes: #2412
Signed-off-by: Miek Gieben <miek@miek.nl>
* typos
Signed-off-by: Miek Gieben <miek@miek.nl>