* mw/kubernetes: add configurable TTL
Add ttl option to kubernetes. This defaults to 5s but allows
configuration to go up to 3600.
Configure the tests so that a few actually check for the 5s, while the
rest use the TTL of 303 which is ignored by the checking code.
Fixes#935
* fix tests
* and more
block chaos queries, unless the chaos or proxy middleware is loaded. We
respond with REFUSED.
This removes the need for each middleware to do this class != ClassINET
if-then.
Also make config.Registry non-public.
Split up the handler_test in four files that all tests their specific
bits. Removed the CNAME sort as there was only 1 answer with a CNAME
and that was a single one.
See #942, this fixes (a bit) the tests in middleware.
* Add set EDNS0 with variable substitution
* Change variable from $ to {}. Un-export constants
* Update README
* Change getRuleData() to ruleData(); Change to use string match from regexp
* 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
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)
* 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
Based up on: #939, but redone in a new PR with some cherry-picked
commits:
aacb91ef0b5dc34247b7
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.
* 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
* 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
* 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
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.
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>
* 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
* 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
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.
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.
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.
* 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
* 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
* 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
* 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>