* 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
* 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
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.
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: 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
* 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
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: 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
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.
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.
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.
* 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