Commit graph

8 commits

Author SHA1 Message Date
Miek Gieben
e49ca86ce4 cleanup: go vet and golint run (#736)
* cleanup: go vet and golint run

Various cleanups trickered by go vet and golint.

* Fix tests and lowercase all errors

Lowercase all errors, some tests in kubernetes use errors from
kubernetes which do start with a capital letter.
2017-06-14 09:37:10 -07:00
Miek Gieben
1c45e262f5 middleware/proxy: remove singleinflight from dns (#717)
Singleinflight interferes with the health checking of upstream. If an
upstream would fail, singleinflight would mirror that error to to other
proxy *iff* multple identical queries would be inflight. This would lead
to marking *all* upstreams as bad, essentially collapsing multiple
upstreams into a SPOF. Clearly not what we want.

Singleinflight does have some nice properties, but I've opted to rip it
out entirely. Caching should almost (but not quite) as good.

Added a test case in test that uses 3 CoreDNS instances to reflect the
setup from #715.

Found another bug as well, where (when the policy would be nil), we
would always Spray even though we've found a healthy host.
2017-06-08 16:06:14 +01:00
Miek Gieben
5ac6020f45 Pr 586 tweaks (#594)
* add proxy tcp

* add truncated for tcp to udp response

* move truncation to scrubbing

* add test that executes upstream over tcp

* middleware/proxy: some tweaks

rename force-tcp to force_tcp to be inline with the rest and use
a dnsOptions struct to put the options in to allow it to be extended.
Add some parse tests as well.

* Fix test and rename dnsOptions Options
2017-03-14 21:32:21 +00:00
Miek Gieben
c5224b1048 Golint (#548)
* linter fixes

* Golint and format code

* fmt
2017-02-22 07:25:58 +00:00
Yong Tang
81af74aad0 Fix import path github.com/miekg/coredns -> github.com/coredns/coredns (#547)
This fix fixes import path from
`github.com/miekg/coredns`
->
`github.com/coredns/coredns`
2017-02-22 06:51:47 +00:00
Miek Gieben
a5f3cb5fe5 La context (#521)
* middleware/proxy: give Exchange a context

Make context.Context the first paramater in the Exchange method.
This is inline with all other query functions.

* up the version
2017-02-11 16:56:04 +00:00
Miek Gieben
123a76c91e middleware/proxy: absorb httpproxy (#481)
* 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
2017-02-06 19:32:48 +00:00
Miek Gieben
52e01264e8 middleware/proxy: implement Exchanger (#480)
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
2017-01-15 08:12:58 +00:00
Renamed from middleware/proxy/client.go (Browse further)