* core: replace GetMiddleware
See the discussion in #881. GetMiddleware would add a `nil` middleware
to the callstack thereby breaking functionality.
This PR drops it in favor of RegisterHandler which is a completely
standalone registry for middleware that want to let it self know to
other middleware.
Currenly *autopath* uses this to call *kubernetes*'s AutoPath method
for dynamic autopathing.
* Drop GetMiddleware
* Register metrics
* drop the panic
* checkpoint
* Pass context through ServeDNS, enable gRPC tracing
* Fix types and make tracer available to proxy. go fmt
* Fix imports
* Use the DoNotStartTrace option
* Change to SpanFilter from DoNotStartTrace
* Use new name (IncludeSpan)
* Final names
* Add tests; fix possible client/conn leaks in grpc
* go fmt
* middleware/proxy: absorb httpproxy
Move the httproxy into proxy. This adds and Exchanger interface which
is used to exchange the messages with the upstream.
The https_google upstream will re-resolve itself and update the upstream
hosts used every 300s.
* Remove and add TODO
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
Use connection pooling for communicating with an upstream, instead of
opening a new socket every time.
This makes the proxy more efficient and allowed for some cleanups.
* Some cleanups
* Some fixes
* more
* Kill pool
* Add nil check
* remove pool
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 :)
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>
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.