aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-08-24tests: CoreDNSServerAndPorts (#972)Gravatar Miek Gieben 24-143/+39
* tests: CoreDNSServerAndPorts Copy from kubernetes.go and renamed to fit the style, adapted almost all callers. This is a mechanicl change, no testdata was changed. * typos
2017-08-24auto: test (#978)Gravatar Miek Gieben 1-1/+1
Increate the sleep duration; this is not a proper fix. The problem here is that this is in test that just starts a CoreDNS instance and thus we don't have levers to make "time speed up". It might be worth checking if there is some LD_PRELOAD hackery that fakes time for the entire test? Fixes #945 (not really, but closing with this)
2017-08-24Small golint cleanup (#977)Gravatar Miek Gieben 1-6/+6
* Small golint cleanup Mostly docs in autopath. * duh
2017-08-23mw/kubernetes: revert if-else for health (#970)Gravatar Miek Gieben 1-51/+53
Do the return early and dedent the rest of the function.
2017-08-23Parse fix (#974)Gravatar Miek Gieben 2-0/+71
* mw/kubernetes: add apex test This adds small test case for apex queries: SOA and HINFO. Fix (obvious) parse bug in parse.go. * Test Ns request also here
2017-08-23mw/kubernetes: remove kPod and kServices (#969)Gravatar Miek Gieben 7-153/+110
Based up on: #939, but redone in a new PR with some cherry-picked commits: aacb91ef0b927683b21d6ee39dbddbd001334854 5dc34247b7d0136d9fe035f6b10d6b3e14ee7f2c This removes kPod and Kservice and creates []msg.Service from k.findPods and k.findServices. Updated few tests which I *think* are correct; they look correct to me.
2017-08-22mw/kubernetes: don't export Pod-mode constants. (#959)Gravatar Miek Gieben 4-42/+43
* mw/kubernetes: don't export Pod-mode constants. * merged
2017-08-22mw/kubernetes: resync to opts (#957)Gravatar Miek Gieben 5-63/+52
* mw/kubernetes: resync to opts Only used to initialize the cache that already has a dnsControlopts, so remove it from the main kubernetes struct. * Fix test * mw/kubernetes: LabelSelector to options as well Labels select is also only used for init. Don't carry it in the main kubernetes struct. * remove this test: can't happen Caddyfile parser will only call setup when it sees kubernetes. * erge gone wrong
2017-08-22mw/kubernetes: Rewrite parseRequest and Readability improvements (#939)Gravatar Miek Gieben 9-166/+187
* mw/kubernetes: rewrite parseRequest Stop looking at the qtype in parseRequest and make k.Namespace a map. Fallout from this is that pkg/strings as it is not used anymore. Also add a few helper functions to make unexposed namespaces easier to see in the code. Add wildcard tests to the middleware tests. * Fix tests Add a whole bunch of comments to document what we are trying to do. * This is now answered * up coverage * duh * Update testcase * Make it nodata
2017-08-22mw/*: updates docs about upstream (#968)Gravatar Miek Gieben 4-5/+8
Upstream allows file structured like /etc/resolv.conf. Update docs. Fixes #709
2017-08-22mw/auto: increate setup coverage (#967)Gravatar Miek Gieben 1-0/+25
Fixes #965
2017-08-22core: hide registerHandler (#964)Gravatar Miek Gieben 11-45/+41
* core: hide registerHandler Remove RegisterHandler and just make it implicit when we look at the handler compilation step. * Rename GetHandler to just Handler Update callers and make auto check Hander in OnStartup. * Up test coverage in erratic * up test coverage
2017-08-21mw/autopath: a minimal bug section (#961)Gravatar Miek Gieben 1-0/+5
Briefly highlight that autopath might return the wrong results to pods in different namespaces. Fixes #778
2017-08-21mw/file: add include test (#960)Gravatar Miek Gieben 1-0/+32
$INCLUDE was fixed in miekg/dns, create tests in CoreDNS so that we know we have the latest version. Fixes #880
2017-08-20travis: drop 1.7 (#956)Gravatar Miek Gieben 1-1/+0
Yes, the previous Go version is important but this doubles the wait on travis. This drops 1.7 from travis. This means we wait for bug reports to show up, or tell people to use the precompiled binaries are docker containers.
2017-08-19Use `go test -i` to install all prerequisite packages (#954)Gravatar Yong Tang 1-1/+2
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-19Disable Travis cache (#953)Gravatar Yong Tang 1-5/+0
It looks like the cached path - `$GOPATH/src` - `$GOPATH/pkg` overlaps with the source path of `$GOPATH/src/github.com/coredns/coredns`. Disable the cache for now. May enable cache in the future if we could exclude `$GOPATH/src/github.com/coredns/coredns` from `$GOPATH/src`. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-19Use `date` instead of `time` as `time` might be reserved word in sh. (#952)Gravatar Yong Tang 1-1/+3
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-19Add `time` in coverage test (#951)Gravatar Yong Tang 1-1/+1
For profiling the time spent in Travis CI. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-19travis: remove -bench and -race from coverage (#949)Gravatar Miek Gieben 2-2/+2
Not needed and already done in the other test (bench is not looked at at all)
2017-08-19Move nonwriter to mw/pkg/nonwriter (#948)Gravatar Miek Gieben 6-46/+46
Make it its own package as shared between autopath and federation. Fixes #933
2017-08-19travis: parallize builds (#947)Gravatar Miek Gieben 2-10/+32
* travis: parallize builds * trying out stuff * order matters
2017-08-19Dns.join (#944)Gravatar Miek Gieben 8-14/+52
* Add dnsutil.Join * Create dnsutil.Join Create Join helper function and move bits in the code over.
2017-08-19backend.Records make it take request.Request (#943)Gravatar Miek Gieben 4-12/+14
This is more general and aligns well with the other methods. Also allows the kubernetes middleware to use it. Fixes #940
2017-08-19mw/kubernetes: remove zone from parseRequest (#938)Gravatar Miek Gieben 3-10/+12
* mw/kubernetes: remove zone from parseRequest State has the zone info as well, so don't need to have it in parseRequest anymore. * Fix up tests * improve test coverage
2017-08-18mw/federation: add federation back as separate mw for k8s (#929)Gravatar Miek Gieben 25-122/+726
* mw/federaration This PR add the federation back as a middleware to keep it more contained from the main kubernetes code. It also makes parseRequest less import and pushes this functionlity down in the k.Entries. This minimizes (or tries to) the importance for the qtype in the query. In the end the qtype checking should only happen in ServeDNS - but for k8s this might proof difficult. Numerous other cleanup in code and kubernetes tests. * up test coverage
2017-08-18mw/autopath: integration test with erratic (#930)Gravatar Miek Gieben 9-22/+126
Add integration test with erratic. For this erratic now also returns an autopath searchpath. This tests the whole chain; i.e registring a searchfunction and calling that from autopath. This tests does a autopathing domain and a non-autopathing one.
2017-08-17mw/kubernetes: add reverse test case (#932)Gravatar Miek Gieben 1-3/+7
Add a non-arpa testcase to the reverse test.
2017-08-16tests: add SortAndCheck helper (#926)Gravatar Miek Gieben 24-520/+58
There was quite some code duplication in a lot of tests to check if an answer was considered Ok. Created a test.SortAndCheck helper function that takes care of this.
2017-08-16Remove use of hostnames in upstreams (#927)Gravatar John Belamaric 1-5/+5
Only IP:Port or file name is allowed.
2017-08-16mw/kubernetes: add reverse_test.go (#922)Gravatar Miek Gieben 4-19/+150
This PR adds a reverse tests that copies some of it from the main integration test. This aids in local testing because you don't need a full k8s setup running. It does the most minimal testing, a successful return and a nodata response that includes the SOA for in-addr.arpa.
2017-08-16Reverse in k8s (#923)Gravatar Miek Gieben 2-1/+38
* mw/kubernetes: reverse zone in ZONE stanza not parsed Properly parse the reverse zone syntax in the ZONES stanza as promised in the README. As short test case to test. * add test
2017-08-14Make CoreDNS build on Go 1.7 (#919)Gravatar insomniac 2-1/+2
2017-08-14mw/kubernetes: remove federation and cidr (#916)Gravatar Miek Gieben 26-808/+190
* mw/kubernetes: remove federation and cidr Remove both as we have a corefile syntax change that handles cidr and remove federation because that is going to be its own middleware. * backwards incompat changes This PR: * removes cidr from kubernetes (core Corefile feature now) * removes federation from kubernets (comes back as new middleware) * [remove autopath - which was already gone, so that already was backwards incompat] * adds `fallthrough` to the *etcd* middleware and makes you enable it. * Fail on unknown properties * documentation * Disable TestHealthCheck as it uses realtime and fails
2017-08-13cidr everywhere: check all middleware (#915)Gravatar Miek Gieben 9-127/+135
* cidr everywhere: check all middleware Add tests for cidr in only that middleware that already tests for this. Check the other ones manually (and put reverse in the tests cases anyway). Make etcd setup_test run without +build etcd tag - it is not needed for this test - move rest of the code to lookup_test.go. Cleanup proxy test a bit and remove TempDir as there is test.TempFile that does the same thing. Fixes #909 * coredns package * Fix test compile
2017-08-13Consolidation of Makefile and Makefile.release (#912)Gravatar Yong Tang 2-23/+18
* Consolidation of Makefile and Makefile.release Several changes: 1. All go specific target like `go generate`, etc. has been moved to Makefile. Now Makefile.release does not repeat go build, etc. related rules. 2. In Makefile.release, the binary build is done through `docker run` and with a fixed specific go version (currently 1.8.3). This will help making sure build process could be reproduced on any dev platform, with no dependency to the golang version installed on the platform. 3. Platform related flags (e.g., "GOOS=darwin") are passed through Makefile (not Makefile.release). Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update to only use `make` without running inside `docker run` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-13Use logo as the title of the README.md (#911)Gravatar Yong Tang 1-1/+1
The logo is pointing to https://coredns.io/images/CoreDNS_Colour_Horizontal.png and provides the link to https://coredns.io Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-12Fix log output of the version string. (#910)Gravatar Yong Tang 1-2/+14
Split version string into two, before: ``` 2017/08/12 19:43:08 [INFO] CoreDNS-010 linux/amd64, go1.8.3, a6d2d7b5 CoreDNS-010 linux/amd64, go1.8.3, a6d2d7b5 ``` After: ``` root@9bd51ffc39aa:/go/src/github.com/coredns/coredns# ./coredns .:53 2017/08/12 19:12:59 [INFO] CoreDNS-010 2017/08/12 19:12:59 [INFO] linux/amd64, go1.8, a6d2d7b CoreDNS-010 linux/amd64, go1.8, a6d2d7b ``` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-11go lint cleanup (#904)Gravatar Yong Tang 1-1/+3
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-11Makefile cleanup (#903)Gravatar Yong Tang 1-29/+12
Remove unused distclean and misc. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-11Add git commit to the version output. (#900)Gravatar Yong Tang 3-5/+8
Now the output would be: ``` ./coredns -version CoreDNS-010 linux/amd64, go1.8, 241e3db ``` In case the local file has been modified, then the output would be (with --dirty): ``` ./coredns -version CoreDNS-010 linux/amd64, go1.8, 241e3db-dirty ``` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-11Add Autopath section to k8s readme (#898)Gravatar Chris O'Haver 1-0/+9
The primary driver for autopath was kubernetes. It addresses a specific need in kubernetes, so it deserves a mention in the K8s README, with an example.
2017-08-11mw/k8s: cleanups (#893)Gravatar Miek Gieben 4-26/+12
* mw/k8s: cleanups Remove some constants that aren't used any more. Make PrimaryZone private because it doesn't need to be exported. Remove test that did not cover corner case as expressed in setup.go * cleanup this as well
2017-08-11README Typos (#897)Gravatar Chris O'Haver 1-3/+3
Found a few typos, spelling, and grammar errors.
2017-08-11Fix some typos in README (#896)Gravatar Chris O'Haver 1-2/+2
remove extraneous "]"s from the syntax def...
2017-08-11Use server block defaults (#894)Gravatar Miek Gieben 3-138/+91
* mw/k8s: Test Federation parsing The test case was there, but there was nothing testing it?!?!?! Add it and split it out of the main setup test which is too long already. Also allow kubernetes a not have a ZONE, just default to the serverblock in that case. Remove test that was blocking that. Cleanup up the readme more. * rewrite README
2017-08-11mw/k8s: use request.Request in parseRequestGravatar Miek Gieben 5-19/+31
2017-08-11mw/k8s: remove k.defaultNsMsg() (#892)Gravatar Miek Gieben 2-16/+3
Remove k.defaultNSMsg() it is just one line of getting the service and it is another method that needlessly uses recordRequest.
2017-08-10go lint cleanup (#891)Gravatar Yong Tang 2-2/+9
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-10Support multiple k8s api servers specification and load balance among api ↵Gravatar Yong Tang 6-5/+171
servers (#820) * Support multiple k8s api servers specification and load balance among api servers This fix adds supports for multiple k8s api servers specification, load balance among api servers. When two or more api servers are specified in kubernetes block (endpoint ...), a proxy is created locally (with randomly generately port). The coredns will points to the generated proxy so that load balancing could be achieved. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Setup initial healthcheck at the beginning Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update README.md for kubernetes middleware and remove whitespaces. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Use middleware/pkg/healthcheck in middleware/kubernetes for api proxy Signed-off-by: Yong Tang <yong.tang.github@outlook.com>