Commit graph

208 commits

Author SHA1 Message Date
Manuel Alejandro de Brito Fontes
d250742d9e Fix k8s build (#278) 2016-09-21 20:05:18 +01:00
Miek Gieben
5301c5af5f Run golint and go vet (#276)
Cleanup the errors and removed deadcode along the way. The leaves
some error laying around, mostly about commenting exported identifier.
We should look hard if those really are needed.
2016-09-21 17:01:19 +01:00
Miek Gieben
8555716046 Cleanups and tests (#272)
For some reasons there was a dnsserver/middleware.go that defined
the middleware handlers. This code was a repeat from
middleware/middleware.go. Removed dnsserver/middleware.go and replaced
all uses of dnsserver.Middleware with middleware.Middleware.

Added dnsserver/address_test.go to test the zone normalization (and to
improve the test coverage). The deleted file will also improve the test
coverage :)
2016-09-19 11:26:00 +01:00
Shawn Smith
1decf52cb2 fix typo (#268) 2016-09-18 15:33:09 +01:00
Miek Gieben
b440b1c8f6 docs: document default startup (#266)
Some small additions to the documentation.
2016-09-18 09:32:06 +01:00
Miek Gieben
80b22a5071 middleware/whois: hook it up
Hook it up properly by adding it to the directives list. And add
the Target to the SRV record to actually return valid DNS messages.
2016-09-17 17:50:16 +01:00
Miek Gieben
30fd224504 middleware/whoami: add (#264)
Add a new middleware that tells you who you are; IP, port and transport
is echoed back.

Also some various cleanup and documentation improvements while at it:

* ResponseWriter: improve the documentation of these helper functions.
* And add an NextHandler for use in tests. Make chaos_test.go and
* whoam_test.go use it.
2016-09-17 17:09:05 +01:00
Yong Tang
ed907d3327 Fix proxy upstream parser issue and add test cases (#263)
This fix tries to fix 261 where proxy upstream parser is not
able to parse upstream correctly.

Several test cases have also been added to cover the changes
and prevent regression in the future.

This fix fixes 261.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-17 07:49:35 +01:00
Yong Tang
50d47a55a2 Fix build error by change kubernetes controller to pkg/client/cache (#262)
Kubernetes moves informer and controller to pkg/client/cache, see:
https://github.com/kubernetes/kubernetes/pull/32718

As a result, coredns build is broken.

This fix fixes the build by making related change with kubernetes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-16 16:31:23 +01:00
Yong Tang
953cfc1de4 Remove lumberjack logger (#257)
* Removed lumberjack from coremain

As is mentioned in 251, this fix removed lumberjack from coremain.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Remove lumberjack from log middleware

As mentioned in 251, lumberjack is not suitable for applications like CoreDNS
so it is removed from the log middleware.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Update log/README.md as lumberjack has been removed

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Adjust default log output from `ioutil.Discard` to `os.Stdout`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-16 15:50:16 +01:00
Miek Gieben
2dd8a687b3 Startup notification (#250)
Stop the caddy message and start our own init notifications.
Log the version of CoreDNS when starting up.
Fix all middleware's setup functions so that return the error prefixed
with *which* middleware was failing; leads to better debuggable errors
when starting up.
2016-09-10 09:16:25 +01:00
Miek Gieben
5216ab6b58 Add tests for normalize.go
Fix some of the documentation in the process.
2016-09-07 12:55:41 +00:00
Miek Gieben
d1f17fa7e0 Cleanup: put middleware helper functions in pkgs (#245)
Move all (almost all) Go files in middleware into their
own packages. This makes for better naming and discoverability.

Lot of changes elsewhere to make this change.

The middleware.State was renamed to request.Request which is better,
but still does not cover all use-cases. It was also moved out middleware
because it is used by `dnsserver` as well.

A pkg/dnsutil packages was added for shared, handy, dns util functions.

All normalize functions are now put in normalize.go
2016-09-07 11:10:16 +01:00
Yong Tang
684330fd28 Add a test for health middleware (#246)
This commit adds a simple test of `TestHealth` for the middleware
of health so that there is basic coverage.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-07 10:01:27 +01:00
Miek Gieben
eea77cc97c Fs (#242)
* play around with fs idea

* docs and fix test

* better docs
2016-09-05 09:32:11 +01:00
Miek Gieben
99170ac62e Better logging for NSEC3
When dropping NSEC3 records provide better logging and add test
for NSEC3 records.
2016-09-03 09:37:36 +01:00
Miek Gieben
9caa607173 Update docs
Update the file and dnssec docs and glarify what is implement and that
we only do NSEC.
2016-08-29 19:15:04 +01:00
Miek Gieben
676dc919a2 Remove conf/ dir
Adjust documentation for k8s and put contents of the k8sCorefile
in the README.md
2016-08-25 07:35:09 +01:00
Miek Gieben
1c31f1e7f3 remove debug 2016-08-23 17:35:20 +01:00
Miek Gieben
47f4e165a0 Fix main startup (#232)
Set version and name of the program. And then call coremain.Run().

The coremain split makes CoreDNS embeddable.

Also see #189 for an old PR.
2016-08-23 16:36:29 +01:00
Michael Richmond
2153d2defd Fix k8s integration tests (#231)
* Adding debug message when starting k8s controller

* Adding work-around for timing issue in k8s integration tests

* Remove unused import

* Fix Makefile for ast package

* Increase k8s verbosity in travis

* Updating TODO list to find root cause of test issue

* go fmt cleanup
2016-08-23 07:15:21 +01:00
cricketliu
938ecbeab9 Update README.md
Grammatical fixes.
2016-08-22 14:40:24 -07:00
cricketliu
9a3fa013d6 Update README.md
Grammatical fixes.
2016-08-22 14:38:33 -07:00
cricketliu
af6ebb7cd9 Update README.md
Grammatical fixes.
2016-08-22 14:33:40 -07:00
cricketliu
6b1d816d5a Update README.md
Grammatical fixes.
2016-08-22 14:29:50 -07:00
cricketliu
62a845ca2a Update README.md
Grammatical fixes.
2016-08-22 14:27:55 -07:00
cricketliu
e0493e898b Update README.md
Grammatical fixes.
2016-08-22 14:25:19 -07:00
cricketliu
58a63f53aa Update README.md
Grammatical fixes.
2016-08-22 14:24:02 -07:00
cricketliu
bfb89d8dba Update README.md
Grammatical fixes.
2016-08-22 14:17:21 -07:00
cricketliu
052387b705 Update README.md
Grammatical fixes.
2016-08-22 14:12:03 -07:00
cricketliu
428c99b7a0 Update README.md
Grammatical fixes plus correction of the reverse-mapping zone for 10.0.0/24.
2016-08-22 14:10:25 -07:00
cricketliu
2666ca7238 Update README.md
Grammatical fixes.
2016-08-22 14:05:56 -07:00
cricketliu
5325dadb7c Update README.md 2016-08-22 14:04:21 -07:00
cricketliu
d51c7baefb Update README.md
Grammatical fixes.
2016-08-22 13:53:00 -07:00
cricketliu
2ad57f0804 Update README.md
More grammatical fixes.
2016-08-22 13:51:54 -07:00
Miek Gieben
82ac70f15a Doc updates
Remove miek.nl in favor of example.org and other smaller cleanups.
2016-08-22 07:47:03 +01:00
Miek Gieben
26f52a99d9 Remove old stuff from caddy and some go vet changes (#227) 2016-08-21 11:28:11 +01:00
Miek Gieben
416603383d Cleanup and fixes (#223)
* Set version to 001
* Remove k8stest, test fails is k8s is not there: touch luck
* Remove server directory: not used anymore
* Disable k8s test (for now)
* gometalinter changes
2016-08-20 23:03:36 +01:00
Miek Gieben
9ac3cab1b7 Make CoreDNS a server type plugin for Caddy (#220)
* Make CoreDNS a server type plugin for Caddy

Remove code we don't need and port all middleware over. Fix all tests
and rework the documentation.

Also make `go generate` build a caddy binary which we then copy into
our directory. This means `go build`-builds remain working as-is.

And new etc instances in each etcd test for better isolation.
Fix more tests and rework test.Server with the newer support Caddy offers.

Fix Makefile to support new mode of operation.
2016-08-19 17:14:17 -07:00
Miek Gieben
21ddfe8290 Move singleflight out of middleware/ (#217)
It is not middleware, so move it up one level. It was also use from
core/ showing that indeed its use is not limited to middlewares.
2016-08-16 09:24:37 -07:00
Michael Richmond
9aaeef6376 Moving k8s support scripts out of code folder (#216)
* Adding pod setup to kubernetes startup scripts

* Adding template description to k8s README.md

* Fix typo.

* Moving kubernetes setup scripts out of go folder

* Fixing script error

* Adding messages to k8s scripts for clarity
2016-08-16 09:12:52 -07:00
Miek Gieben
34ffb2b314 Fix TestStubLookup and TestLookup (#213)
Changes large parts of proxy lookup mechanism.

The duplicate zone checking erroneous added a nameserver for each
zone we are auth. for, creating to many backend hosts. So even when a
host was determined do be Down() we still got an (identical) new one
from the list.

The Down() and failure checking for upstream hosts had data race in the
uh.Fails check - we now use atomic.LoadInt32 for that.

Use and debug the test/server.go test servers implementation in the
TestStubLookup test to prevent going out to the internet.

Also delete the stub cycle test. That test was wrong and did not test
what it needed to be testing.  Deleted for now.
2016-08-14 12:57:49 -06:00
elcore
6d3f9d2193 Set Authoritative Answer - DNSKEY (fix #210) (#212)
* Authoritative Answer - DNSKEY

* Improve Style
2016-08-14 11:19:36 -07:00
Miek Gieben
cdb7cb68ed Merge branch 'master' of github.com:miekg/coredns 2016-08-14 07:31:13 -07:00
Miek Gieben
e85a8260e3 middleware/dnssec
Add warning about in memory keys and the impossibilty to extract them.
2016-08-14 07:30:41 -07:00
Michael Richmond
ad2838b916 Adding label selector support to Corefile (#208)
* Adding parsing for label selector to Corefile

* Updating comment typo in k8sCorefile

* Adding implementation of label support to filter exposed objects

* Updating TODO list
2016-08-12 20:44:08 -07:00
Miek Gieben
3b7b9b49d5 Fix lookup test (#206)
* Always continue

* debug queries: more sane impl

This PR just add a msg.Service to debug instead of crafting an TXT RR
at that point. This way we lift on the normal way of generating debug
responses and don't muck with that implementation.

The tags=etcd is flaky as hell for some reason.
2016-08-08 21:42:39 -07:00
Miek Gieben
b53661d223 Add debugging for failed lookups (#199)
This PR adds debug support for failed lookups. I.e. when a record
is outside the configured domain, we do a forward lookup. If this
fails the error is silently dropped. This PR adds it back as an error
in when debugging is enabled.

Fixes #197
2016-08-08 19:54:17 -07:00
Miek Gieben
ad76aef5fc Fix stubzone retention (#198)
Make the receiver a pointer so that the uptdateStubZones map update will
retain the stubzones found, unlike the current case where the update
will be applied and then promptly forgotten, because it is working on a
copy.

Add test/etcd_test.go to test a large part of the code. This didn't
catch the chaos middleware hack though. The chaos middleware zones are
now *not* automatically added. You have to take care of that by yourself
(docs updates).

When using debug queries and falling through to the next middleware in
etcd, restore the original (with o-o.debug) query before passing it on.
2016-08-08 19:18:55 -07:00
Michael Richmond
c079de65b5 Adding resyncperiod to Corefile (#205)
* Removing old unused inline k8s API code and tests.
* Adding parsing implementation for `resyncperiod` keyword from Corefile.
* Adding tests for parsing `resyncperiod` keyword from Corefile.
8 Updating README.md and conf/k8sCorefile.
2016-08-08 14:30:04 -07:00