* 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: 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
Add some docs about normalize.Host and normalize.Name. They are used
correctly in the middleware even though they are somewhat confusing,
esp when you copy from ServerBlockKeys in your middleware.
* middleware/file: don't reload zone when SOA isn't changed
Give Parse an extra argument which is the SOA's serial, if > 0 we check
against the just parsed SOA and then just return.
Most notable use is in reload.go which is both used in the file and auto
middleware.
Fixes#415
* PR comments
* middleware/file: correctly parse the stanza
Parsing the file stanza would give precedence to 'transfer' and ignore
other bits if it wasn't specified.
This change fixes the parsing. The actually external CNAME retrieval is
working fine (once the upstream is correctly parsed).
This wasn't caught in tests, because we lack a parsing test for this.
Fixes#657
* Add tests
By defining and using an proxy.Exchanger interface we make the proxy
more generic and we can then fold back httproxy into proxy.
This overrides #463 and #473 and should make futures extensions rather
trivial
* Add docs that talk about `protocol` and how to set it.
* middleware/proxy: rename New to NewLookup
It's used as a Lookup mechanism not as a completely new proxy,
reflect that in the name.
* Set maxfails to 3 by default when looking up names.
Most of the changes have been copied
from https://github.com/johnbelamaric/coredns/pull/1/files
* middleware/proxy: config syntax cleanups
Allow port numbers to be used in the transfer statements and clean
up the proxy stanza parsing. Also allow, when specifying an upstream,
/etc/resolv.conf (or any other file) to be used for getting the upstream
nameserver.
Add tests and fix the documentation to make clear what is allowed.
* Fix the other upstream parse as well
Add auto-load middleware that automatically picks up zones.
Every X seconds it will scan for new zones.
Add tests and documentation.
Make 'make test' use -race.
In the file middleware, if there are multiple zone files under a single root zone, watchers are only invoked on the last element of `zones.Names`. This is caused by loop override on the variable `n`.
This issue can be fixed by passing zone object, which calls reload watcher directly.
This PR adds the *root* middleware that specifies a path where
all zone file (the *file* middleware is the only consumer now) can
be found. It works the same as in Caddy.
Documentation can be found in the README.md of the middleware.
Fixes#307
* Fix linter errors
* More linting fixes
* More docs and making members private that dont need to be public
* Fix linter errors
* More linting fixes
* More docs and making members private that dont need to be public
* More lint fixes
This leaves:
~~~
middleware/kubernetes/nametemplate/nametemplate.go:64:6: exported type NameTemplate should have comment or be unexported
middleware/kubernetes/nametemplate/nametemplate.go:71:1: exported method NameTemplate.SetTemplate should have comment or be unexported
middleware/kubernetes/nametemplate/nametemplate.go:108:1: exported method NameTemplate.GetZoneFromSegmentArray should have comment or be unexported
middleware/kubernetes/nametemplate/nametemplate.go:116:1: exported method NameTemplate.GetNamespaceFromSegmentArray should have comment or be unexported
middleware/kubernetes/nametemplate/nametemplate.go:120:1: exported method NameTemplate.GetServiceFromSegmentArray should have comment or be unexported
middleware/kubernetes/nametemplate/nametemplate.go:124:1: exported method NameTemplate.GetTypeFromSegmentArray should have comment or be unexported
middleware/kubernetes/nametemplate/nametemplate.go:135:1: exported method NameTemplate.GetSymbolFromSegmentArray should have comment or be unexported
middleware/kubernetes/nametemplate/nametemplate.go:167:1: exported method NameTemplate.IsValid should have comment or be unexported
middleware/kubernetes/nametemplate/nametemplate.go:182:6: exported type NameValues should have comment or be unexported
middleware/kubernetes/util/util.go:1:1: package comment should be of the form "Package util ..."
middleware/kubernetes/util/util.go:27:2: exported const WildcardStar should have comment (or a comment on this block) or be unexported
middleware/proxy/lookup.go:66:1: exported method Proxy.Forward should have comment or be unexported
middleware/proxy/proxy.go:24:6: exported type Client should have comment or be unexported
middleware/proxy/proxy.go:107:1: exported function Clients should have comment or be unexported
middleware/proxy/reverseproxy.go:10:6: exported type ReverseProxy should have comment or be unexported
middleware/proxy/reverseproxy.go:16:1: exported method ReverseProxy.ServeDNS should have comment or be unexported
middleware/proxy/upstream.go:42:6: exported type Options should have comment or be unexported
~~~
I plan on reworking the proxy anyway, so I'll leave that be.
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 :)
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.
* 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.