Commit graph

10 commits

Author SHA1 Message Date
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
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
Carl-Magnus Björkell
a84c26d78b plugin/etcd: Filter empty host field by qtype (#2499)
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-28 16:38:27 +00:00
Miek Gieben
725becd134
Stop importing testing in the main binary (#2479)
* 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-19 11:23:13 +00:00
Carl-Magnus Björkell
cfbfa5c00e plugin/etcd: propagate recursion flag properly (#2254)
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.
2018-10-31 21:08:58 +00:00
Miek Gieben
22c0b30d5f presubmit: Check errorf as well (#1845)
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.
2018-06-02 11:48:39 -07:00
Miek Gieben
284061eee7 pkg: add dnstest (#1098)
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.
2017-09-21 15:15:47 +01:00
Miek Gieben
be47709270 More Middleware -> Plugin conversions (#1088)
Forgot about these.
2017-09-16 14:13:28 +01:00
Miek Gieben
d8714e64e4 Remove the word middleware (#1067)
* 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)