Commit graph

1208 commits

Author SHA1 Message Date
Miek Gieben
22c0b30d5f presubmit: Check errorf as well (#1845)
Uppercase all these test errors as well. And extend the presubmit to
check for these in the future. Also do a slightly smarter grep to only
get t.<something>. as (because dump regexp) this also grep over non test
files.
2018-06-02 11:48:39 -07:00
Mario Kleinsasser
6fcb2dda77 Add addition documentation for hosts plugin, fix #1825 (#1836)
Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Rework the documentation

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>
2018-05-27 20:31:29 +01:00
Ruslan Drozhdzh
833e3ddaf0 plugin/forward: erase expired connections by timer (#1782)
* plugin/forward: erase expired connection by timer

 - in previous implementation, the expired connections resided in
   cache until new request to the same upstream/protocol came. In
   case if the upstream was unhealthy new request may come long time
   later or may not come at all. All this time expired connections
   held system resources (file descriptors, ephemeral ports). In my
   fix the expired connections and related resources are released
   by timer
 - decreased the complexity of taking connection from cache. The list
   of connections is treated as stack (LIFO queue), i.e. the connection
   is taken from the end of queue (the most fresh connection) and
   returned to the end (as it was implemented before). The remarkable
   thing is that all connections in the stack appear to be ordered by
   'used' field
 - the cleanup() method finds the first good (not expired) connection
   in stack with binary search, since all connections are ordered by
   'used' field

* fix race conditions

* minor enhancement

* add comments
2018-05-25 23:00:11 +01:00
Miek Gieben
94ced8255b
RFC dont have a hyphen (#1837) 2018-05-25 11:43:54 +01:00
Miek Gieben
2758a756dd
Implement deprecation notice for 1.1.4 (#1833)
* Implement deprecation notice for 1.1.4

This still allows all the config to be parsed, but noops it:

* -log; always set the log to stdout; no matter what.
* https_google; removed from the proxy implementation.
* reverse plugin: set to deprecated.

* Whole of reverse can go

* Remove test for deprecated plugin
2018-05-24 14:30:01 +01:00
Miek Gieben
c0fbef0714
generate doc for 1.1.3 (#1832) 2018-05-24 07:51:59 +01:00
darkweaver87
003e104fca ADD ignoreemptyservice option for kubernetes plugin (#1813)
* ADD: ignoreemptyservice option for kubernetes plugin

* Modify documentation and rename option to add space

* UPD: Add unit tests

* UPD: gofmt

* Add unit test for ignore emptyservice

* gofmt

* xfr tests failed

* Rename emptyservice to empty_service
2018-05-23 08:57:59 -04:00
Miek Gieben
0f74281a53 Revert pkg/nonwriter changes (#1829)
The DoH work (#1619) made changes to pkg/nonwriter.Writer that in
hindsight were not backwards compatible; it added override for the
LocalAddr() and RemoteAddr(). Instead of rolling back that PR, this PR
reverts those changes and creates a DoHWriter for use in the
https-server.go side of things.

This was only caught in the integration test making this hard to catch,
so we add a upstream_file_test.go that tries (doesn't work yet) to test
this in the unit tests as well. Esp. helpful when 'git bisecting'.

Fixes #1826
2018-05-23 08:50:27 -04:00
Ahmet Alp Balkan
49891d2103 Add links to whoami plugin reading material (#1815)
* Add links to whoami plugin reading material

* create See Also section
2018-05-22 15:38:25 +01:00
Miek Gieben
18b92e1117
make CoreDNS DoH Server (#1619)
* WIP: make CoreDNS DoH Server

* It works

* Fix tests

* Review from Tom - on diff. PR

* correct mime type

* Cleanups and use the pkg/nonwriter

* rename and updates

* implement get

* implement GET

* Code review comments

* correct context

* tweaks

* code review
2018-05-21 19:40:46 +01:00
Yong Tang
67c9075331 Enforcing gofmt -s on linter check (#1820)
This fix enforces gofmt -s on linter check in Makefile,
and fixes `plugin/kubernetes/handler_test.go` and
`plugin/tls/tls_test.go` with `gofmt -s`
2018-05-21 09:52:42 -04:00
Tobias Schmidt
0d305387f7 plugin/template: Support NODATA responses (#1816)
A NODATA response has no answers and rcode NOERROR, but should have a
SOA record in the authority section.
2018-05-21 07:45:45 +01:00
Ruslan Drozhdzh
7ac507d9ff plugin/forward: close connection manager in proxy finalizer (#1768)
- connManager() goroutine will stop when Proxy is about to be
   garbage collected. This means that no queries are in progress,
   and no queries are going to come
2018-05-18 07:46:14 +01:00
Chris O'Haver
38e27fd9ad add dup endpoint name test (#1811) 2018-05-18 07:27:25 +01:00
Anton Antonov
a9f3ad1f0b Fix typo in erratic.go (#1812) 2018-05-17 16:59:57 -04:00
Yong Tang
9a82fa0374 golinter fix (#1807)
This fix fixes golinter warning:
```
plugin/tls/tls_test.go:1:⚠️ file is not goimported (goimports)
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-05-16 22:35:31 +01:00
Ruslan Drozhdzh
cffa1948ab Probe simplification (#1784)
* Probe simplification

 - the main reason of rework is that previous implementation hung
   when calling Do() after Stop()

* replace atomics with mutex

* access Probe.interval under lock
2018-05-16 20:38:13 +01:00
Ruslan Drozhdzh
bffb955f69 plugin/tls: make CA parameter optional (#1800) 2018-05-15 12:53:46 -04:00
Chris O'Haver
8026dc2560
plugin/reload: mention auto in reload (#1793)
mention auto in reload docs
2018-05-11 15:09:38 -04:00
Chris O'Haver
afed91646a
plugin/proxy: fix except example (#1796)
I just noticed this discrepancy in one of the `except` examples.
2018-05-11 13:51:21 -04:00
Chris O'Haver
2c04e72bdc
Try to clarify rewrite docs (#1795)
making response rewrites more prominent
2018-05-11 13:50:59 -04:00
Miek Gieben
3dd459896a
Add OWNERS to forward (#1789)
Copy the OWNERS file from proxy and add rdrozhdzh to it.
2018-05-10 07:41:03 +01:00
Miek Gieben
874a998697 plugin/errors: remove panic/recover (#1777)
Remove panic/recover and also use pkg/log to print the error. This
brings some consistency into the logging.

Fixes #1776
2018-05-09 19:04:46 -07:00
Francois Tur
30309861c5 - review BUG related doc for Health and Premotheus after change of behavior to be compatible with reload feature. (#1790) 2018-05-09 15:09:06 +01:00
Eugen Kleiner
b9f0d55fc9 plugin/forward: expose TLSConfig and error messages to public (#1781)
* plugin/forward: expose TLSConfig and error messages to public

* Add IsTLS() instead of TLSConfig()
2018-05-09 12:41:14 +01:00
Miek Gieben
0e5e59c327
request.Match check Response bit as well (#1775)
* request.Match check Response bit as well

We should check this bit and reject them as invalid.

* Fix test
2018-05-09 12:35:42 +01:00
Miek Gieben
68b45f5377
plugin/cache: unroll minTTL loop (#1773)
This allocates memory because of the append, just unroll the loop.
Also add benchmark.

Before:
goos: linux
goarch: amd64
pkg: github.com/coredns/coredns/plugin/cache
BenchmarkCacheResponse-4   	  100000	     11910 ns/op
BenchmarkMinMsgTTL-4       	 1000000	      1494 ns/op
PASS

After:
goos: linux
goarch: amd64
pkg: github.com/coredns/coredns/plugin/cache
BenchmarkCacheResponse-4   	  100000	     12016 ns/op
BenchmarkMinMsgTTL-4       	 2000000	       668 ns/op
PASS
2018-05-08 18:36:29 +01:00
Miek Gieben
565e416407
plugin/cache: don't recheck the OPT records (#1772)
These are not stored with newItem so we don't have to check them later.
2018-05-08 18:36:08 +01:00
Ruslan Drozhdzh
0455febc34 fix TestNewServer() hanging (#1786) 2018-05-08 18:35:47 +01:00
Miek Gieben
643550eabe presubmit: check for uppercase (#1774)
Another thing we can test automatically, we sorta settled on using an
uppercase letter in in t.Log and t.Fatal calls.

Let's just check for this.
2018-05-07 23:47:25 +02:00
Miek Gieben
7c27577707
plugin/metrics: add panic counter (#1778)
Count and export number of panics we see.

Fixes #1294
2018-05-05 19:47:41 +02:00
John Belamaric
bf479f9ac2 gofmt some stuff (#1769) 2018-05-04 22:45:58 +02:00
Eugen Kleiner
be8fcc484a plugin/forward: expose few methods and attributes to public (#1766)
* plugin/forward: expose few methods and attributes to public

* Update comments
2018-05-04 07:47:26 +02:00
Miek Gieben
5735292406
Do Compress only when need in request.Scrub (#1760)
* Remove Compress by default

Set Compress = true in Scrub only when the message doesn not fit the
advertized buffer. Doing compression is expensive, so try to avoid it.

Master vs this branch
pkg: github.com/coredns/coredns/plugin/cache
BenchmarkCacheResponse-2   	   50000	     24774 ns/op

pkg: github.com/coredns/coredns/plugin/cache
BenchmarkCacheResponse-2   	  100000	     21960 ns/op

* and make it compile
2018-05-01 21:04:06 +01:00
Miek Gieben
c48531bb35
Add usage example (#1759) 2018-04-30 20:53:23 +01:00
Miek Gieben
a8fce24d46
plugin/cache: fix benchmark (#1758) 2018-04-30 20:25:40 +01:00
Miek Gieben
c0590e4ec4
plugin/etcd: small refactor (#1749)
* plugin/etcd: small refactor

I think this function can be smaller.

* and make it compile
2018-04-28 10:03:35 +01:00
Miek Gieben
bfc647d4ed
Cache metrics server (#1746)
* plugin/cache: per server metrics

Use per server metrics in the cache plugin as well. This required
some plumbing changes. Also use request.Request more.

* fix cherry-pick
2018-04-27 19:37:49 +01:00
Miek Gieben
85f549b529
plugin/dnssec: add per server metrics (#1743)
* plugin/dnssec: add per server metrics

final plugin.

Fixes #1696 #1492 #1189

* Move cache cap into handler so we can access the server label

* Remove cache-capacity from it entirely
2018-04-27 19:37:31 +01:00
Miek Gieben
2a28efa877
plugin/template: update metrics to include server (#1731)
Add server label to the metrics and update the README.
2018-04-27 19:37:12 +01:00
Mario Kleinsasser
13b1f5469a Fix #1685 (#1700)
Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Create separate function for zone check

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Add tests for zone A records

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Remove pointer from checkZoneForRecord func signature, Add documentation

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Change apex to zone, Update readme information, Add additional tests

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Change zone to apex

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Change readme to reflect apex change

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Correct code comment

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Correct string join for apex.dns

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>
2018-04-27 19:36:58 +01:00
John Belamaric
9d25b6d8b9 Update README.md (#1748) 2018-04-27 10:25:46 -04:00
John Belamaric
7ec92e055d
Update README.md 2018-04-27 09:49:25 -04:00
Miek Gieben
f0f80ed739
plugin/forward: clarify relation with proxy (#1747)
some other small bits as well.
2018-04-27 14:24:58 +01:00
Chris O'Haver
47b2b10209 plugin/rewrite: handle continue in response rewrite (#1740)
* handle continue in response rewrite

* add test
2018-04-27 07:05:44 +01:00
Miek Gieben
3236464223
plugin/kubernetes: document tranfer (#1745)
Fixes #1720
2018-04-26 21:29:29 +01:00
Miek Gieben
270da82995
plugin/forward: move Dial goroutine out (#1738)
Rework the TestProxyClose - close the proxy in the *same* goroutine
as where we started it. Close channels as long as we don't get dataraces
(this may need another fix).

Move the Dial goroutine out of the connManager - this simplifies things
*and* makes another goroutine go away and removes the need for connErr
channels - can now just be dns.Conn.

Also:

Revert "plugin/forward: gracefull stop (#1701)"
This reverts commit 135377bf77.

Revert "rework TestProxyClose (#1735)"
This reverts commit 9e8893a0b5.
2018-04-26 09:34:58 +01:00
Miek Gieben
4c7ae4ea95
plugin/health: update README (#1739)
* plugin/health: update README

Make more clear in the readme that health is limited to 1 server.

Fixes #1722

* rephrase and remove ~~~ corefile because it will fail
2018-04-26 08:44:33 +01:00
Chris O'Haver
5e06687ee5 plugin/rewrite: tweak parse error messaging, add tests (#1737)
* tweak parse error messaging, add tests

* looser err msg checking
2018-04-25 20:48:32 +01:00
Ruslan Drozhdzh
9e8893a0b5 rework TestProxyClose (#1735) 2018-04-25 19:15:49 +01:00