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.
* 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
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.
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.
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...
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).
* 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
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.
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
* 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
* 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
* 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
* 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
* 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
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.
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.
Cant' transfer zone from masters without populating `f`.
This error prevents secondary zones recognized as "true" secondary, so secondary setting never worked.