* 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>
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.
* 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>
When fetching records via the etcd plugin, the recursion flag was never
set properly according to if the caller requested an exact record match
or not. This cause problems especially in CNAME lookups, where recursion
took place and a random RR was returned instead of the one that was
specifically added for this key. Even when there is no service attached
on the given path, it is still wrong to return a random one from the
recursion.
Fixing by using the `exact` flag to decide if recursion should be done.
Uppercase all these test errors as well. And extend the presubmit to
check for these in the future. Also do a slightly smarter grep to only
get t.<something>. as (because dump regexp) this also grep over non test
files.
Add a full test server impl in this new package + tests. Move
dnsrecorder into this package as well and finish up the commented out
tests that were left in the old dnsrecorder package.
Update all callers and tests.
* Rename middleware to plugin
first pass; mostly used 'sed', few spots where I manually changed
text.
This still builds a coredns binary.
* fmt error
* Rename AddMiddleware to AddPlugin
* Readd AddMiddleware to remain backwards compat
2017-09-14 09:36:06 +01:00
Renamed from middleware/etcd/cname_test.go (Browse further)