Commit graph

516 commits

Author SHA1 Message Date
Miek Gieben
b8e2c476a5 mw/authpath: hook in kubernetees (#860)
Call out to kubernetes to get the search path - this still needs
to return something sensible, but all infrastructure has landed
to make it work.
2017-08-09 04:06:48 -07:00
Miek Gieben
b46b9880bd WIP: autopath as middleware (#859)
autopath as middleware
2017-08-09 03:13:38 -07:00
Miek Gieben
c3705ec68c mw/kubernetes: warn about deprecating cidr (#858)
Add log statement pointing to replacement.
remove cidr from README and use replacement syntax.

Fixes #851
2017-08-08 05:05:34 -07:00
Miek Gieben
be551f21a0 core: add missing trimzone files
*ugh*: forgot to add these files. This add the dnsutil.TrimZone
function.
2017-08-08 11:33:51 +00:00
James Mills
fbf135d265 Fix build error with incorrect arguments to SetDo() (#856) 2017-08-08 01:29:54 -07:00
张勋
a04fe81bd8 Change default MaxIdleConnsPerHost of Etcd client’s http.Transport (#853) 2017-08-07 23:27:33 -07:00
Miek Gieben
0bc1ff7408 mw/kubernetes: autopath refactors (#850)
Factor out as much of autopath into a subpackage as possible right now.
apw.Sent is not needed, we should see this from the rcode returned by
the middleware. See #852 on why this was needed.

Disable the tests for now as to not break the main build.
2017-08-07 14:45:30 -07:00
Miek Gieben
e1c1521ad5 Core: convert IP addresses to reverse zone (#838)
* Core: convert IP addresses to reverse zone

If we see IP/mask syntax and the mask mod 8 == 0 we assume a reverse
zone and convert to in-addr or .arpa.

* typos

* integration test

* Addr is not used

* core: clean up normalize

Create a SplitHostPort function that can be used both from normalize.go
and address.go. This removes some (not all!) duplication between the
both and makes it work with reverse address notations.

* More tests
2017-08-07 13:24:09 -07:00
Miek Gieben
468d5b57de core: export ClientWrite (#849)
Make ClientWrite available for middleware to use.
2017-08-07 07:39:57 -07:00
Miek Gieben
760e667063 middleware/kubernetes: autopath in sub package (#848)
Put the autopath stuff in a separate sub package. Tests are still
included in the main kubernetes directory.

Next steps (after this is merged), is pulling the autopath handling
into the subpackage and fixing the tests.
2017-08-07 07:09:32 -07:00
Miek Gieben
050eccd69e mw/logs: add rflags to logging (#845)
Add the DNS message response flags as {rflags} to the default logging
Also complete the replacer testing that is was commented out.
And (unrelated) Switch erratic and whoami to ease testing.

Note: {flags} could and should be added as well - but we can leave that
as a beginners bug.
2017-08-07 03:49:40 -07:00
Miek Gieben
bcb2eb1ecc all: gometalinter (#843)
* kubernetes/reverse: remove deadcode
* deadcode in errors and kubernetes removed
* unnecessary conversion
* constants
* proxy: time.Since()
* simplications
* static check
* Disable test/external_test
2017-08-06 05:54:24 -07:00
Miek Gieben
964f04f443 middleware/secondary: add jitter (#841)
randomize the times when doing transfers and checks.

Fixes #840
2017-08-06 02:22:50 -07:00
Miek Gieben
c84df38ac5 middleware/kubernetes: fixes (#837)
dedent code, use shorter names.
use strings.EqualFold instead ToLower to avoid create garbage.
2017-08-05 12:29:43 -07:00
Miek Gieben
a235833be8 middleware/secondary: pull all zones (#834)
Use the same OnStartup setup as in the file middleware. We need to copy
the variable from range, otherwise it gets overwriten in the next loop
because of the async goroutine call.

Hard to test, we have secondary_test.go which we could extend with
multiple zones for instance. For now this fix does not have an test case
with it...
2017-08-05 01:36:11 -07:00
Miek Gieben
b11cf7c2bc not used anymore (#832) 2017-08-04 16:03:30 -07:00
Yong Tang
7ca018374f golint cleanup (#828)
Clean up some golint related issues.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-04 09:46:40 -07:00
Yong Tang
c08497adee Misspell correction (#826)
Did a `misspell . | grep -v ^vendor` and fixed
several typos.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-04 09:06:06 -07:00
Miek Gieben
21386ebdd5 middleware/kubernetes: define consts (#824)
Define two consts Pod and Svc, makes it stand out a little more
when used in switches in case.

We have opted for a new type, but then you need to convert them
all the time with string(Foo).
2017-08-04 10:34:00 -04:00
Markus Sommer
d0d7f4c89a Kubernetes srv (#823)
* Treat absence of port/service in SRV as wildcard

Normally, a SRV-request should have the form
_<service>._<port>.<name>.<zone>. The k8s peer-finder which is used for
bootstrapping by some applications will however query for SRV at
<name>.<zone>.

To compensate for this behaviour, treat the absence of _<service> and
_<port> as wildcards.

* Modified tests with new SRV behaviour

Added a testcase for a SRV request without port & service
Removed now valid query from invalidSRVQueries

* Forgot to run gofmt on test/kubernetes_test.go
2017-08-04 09:41:55 -04:00
Miek Gieben
2c0fc3182c middleware/kubernetes: cleanup (#818)
Drop the interfaceAddr interfaces and just use a function. Cleanup
all fallout from that. Remove the use of global variables and cleanup
the tests a bit.
2017-08-03 23:14:11 -07:00
Sandeep Rajan
8ad8c75ab4 Middleware/k8s: Add unit tests for Pods (#815)
* Added Pod testing

* Cleanup

* fixed formatting
2017-08-03 12:16:50 -07:00
Miek Gieben
cd1f2f1bbf mw/kubernete: small cleanup (#810)
* mw/kubernete: small cleanup

Small cleanup, avoid pointer to []msg.Services and just returns the
msg.Service.

* Actually compile

* testss
2017-08-03 09:03:53 -07:00
Sandeep Rajan
2410f5b3f4 Add TXT coverage (#807) 2017-08-02 12:42:15 -04:00
Miek Gieben
78db9fbb10 middleware/backend: send proper reponse on NODATA (#804)
SOA would blindly add "." + zone, which when using the root
zone would create a unparseable packet with "name.."
2017-07-31 10:48:50 -07:00
Miek Gieben
9b805988f4 README.md: clean TLS cert language (#797)
Cleanup various READMEs to use the same naming scheme for certs, keys,
and cacerts.

Fixes #762
2017-07-29 04:03:55 -07:00
Miek Gieben
7d1b0cf2e1 doc: small update
Lower-case dnstap in the readme and update Makefile.release to point to
the new website.
2017-07-26 08:55:06 +01:00
varyoo
82954c1c29 resolve #789 (#791) 2017-07-25 13:14:01 -07:00
Miek Gieben
07c7ac80e7 middleware/file: fix multiple wildcards (#787)
Don't hold on to the *first* wildcard you'll find, but keep searching,
there may be one even deeper in the tree.
Also add multi level wildcard test

Fixes #776
2017-07-24 14:21:40 -07:00
varyoo
1b7492be6e WIP: middleware/dnstap (#711)
middleware/dnstap add
2017-07-24 14:12:50 -07:00
Miek Gieben
f33b02689c Fix all READMEs and some other fluff (#788) 2017-07-24 08:24:53 -07:00
Miek Gieben
1e6f134783 Small doc style updates in the host middleware 2017-07-23 21:15:16 +01:00
Miek Gieben
df137d971c mw/file: wildcard at apex fix (#785)
* mw/file: wildcard at apex fix

This adds a test case (that does passes!)

* completer test
2017-07-21 03:44:36 -07:00
Pat Moroney
6f152dd8fd hosts middleware should return NoError if other records exist in the zone (#782)
* hosts middleware should return NoError if other records exist in the zone

* return RcodeSuccess for hosts queries for non A,AAAA records if the zone exists

* return NXDOMAIN instead of REFUSED when zone is not found
2017-07-20 18:09:15 -04:00
Chris O'Haver
58006cf847 middleware/kubernetes: fix aaaa response (#780)
* fix aaaa response

* unit tests
2017-07-20 08:19:29 -04:00
Miek Gieben
49c8f07cd6 middleware/reverse: small doc cleanup 2017-07-13 10:12:10 +00:00
Chris O'Haver
8495e48297 k8s/autopath: Add CNAMES (#771)
* Add unit tests & cnames

* more progress

* fix

* next mw dependent unit tests

* add tests for OnNXDOMAIN

* Add AAAA and ndots unit tests; fix request.NewWithQuestion

* Correct default value in README

* add CNAMEs to readme

* review

* fix autopath examples

* fix and test CNAME response order
2017-07-11 18:05:32 -04:00
jremond
0049230a93 add wildcard parameter to allow resolving multiple name to the same IP (#755)
* add wildcard parameter to allow resolving multiple name to the same IP

* first test for the reverse wildcard middleware

* update wildcard keyword test to pass code coverage
2017-07-10 22:49:24 -06:00
Chris O'Haver
21b0038b54 remove unused code (#774) 2017-07-07 12:44:30 -07:00
Mia Boulay
ade7603021 middleware/backend: add Records() to ServiceBackend interface (#770) 2017-07-01 15:19:57 -07:00
Mia Boulay
7fada97ee3 middleware/etcd: move NewHTTPTransport to pkg/tls (#769) 2017-07-01 13:17:53 -07:00
Mia Boulay
7e97379bc5 middleware/etcd: remove double switch in setup.go (#768) 2017-07-01 13:17:09 -07:00
Chris O'Haver
25d116d4ae middleware/kubernetes: Rewrite/expand readme (#764)
* rewrite readme

* remove breaks

* missed a break

* nits

* show options as optional
* add note to pods insecure
* add minimal configuration example.
* add a note about replacing kube-dns in the summary
* move deployment section into summary.

* Update README.md

* replace options sections with bullets

and indent all sub sections to match bullet indentation.
not sure if this will render in github properly - it doesn't in the in-line editor preview.

* fix indentation

Contrary to various on-line guides and editors, github now requires 2 spaces to indent paragraphs with bulleted sections above (not just 1).

* Update README.md

* Update README.md

* Update README.md

* fix label syntax

It's just a single EXPRESSION.  The EXPRESSION itself has its own kubernetes label expression format.

* Update README.md

* Update README.md
2017-07-01 00:20:21 -07:00
ghostflame
bb05a665eb middleware/proxy: async health checks (#749)
* Switches out Unhealthy bool for OkUntil timestamp

* Make sure servers are healthy forever if there are no health checks

* Moves health check off into a go routine to avoid blocking conditions

* Improved logging info

* Fixes initial date

* Fixes health checking; alters tests to adapt to async health checking

* Moves future variable into static upstream and populates it in more places

* Restores silencing of stdout during testing

* Restores silencing of stdout during testing

* keeps check url string once built

* Removes debug message

* uses zero value to signal no checking; reduces in-mutex code to a fetch
2017-06-30 02:13:45 -07:00
Chris O'Haver
edf71fb168 middleware/kubernetes: Server side path lookups (#750)
* initial commit

* add config options

* add readme

* rewording

* revert unlreated change

* normalize host domain path

* add ndots opt, allow > 1 host domains, pull host domains from resolv.conf

* implementing review feedback

* update readme

* use dns lib, config format, defaults

* Correct autopath example.
2017-06-28 18:44:30 -04:00
Miek Gieben
da5880a273 middleware/cache: fix race (#757)
While adding a parallel performance benchmark I stumbled on a race
condition (another reason to add performance benchmarks!), so this
PR makes sure the msg is created in a race free manor and adds the
parallel benchmark.
2017-06-26 07:44:25 -07:00
jremond
ea90702bfc Reverse middleware change ipseparator (#753)
* change IPv4 separator from - to .

* fix reverse middleware tests and README to adapt with . instead of -
2017-06-25 01:59:33 -07:00
Chris O'Haver
6f9a9eb8cd dont load default vals from env (#751) 2017-06-23 18:02:45 -04:00
Miek Gieben
9fb266aebe middleware/secondary: multiple fixes (#745)
Fix transferring the zone from a master and the matching of notifies
to source and dst IP addresses.

Add `upstream` keyword as well, because it is needed for the same
reasons as in the *file* middlware.
Add some dire warning about upstream in the readme of both middlewares.

Out of band testing, hidden by net build tag was added. Integration
testing still needs to be setup.
2017-06-21 23:46:20 -07:00
Roman Mazur
3c6964ac9d No f in in line 73 in coredns/middleware/secondary/setup.go (#721)
Cant' transfer zone from masters without populating `f`.
This error prevents secondary zones recognized as "true" secondary, so secondary setting never worked.
2017-06-20 14:38:05 +01:00