coredns/plugin
Miek Gieben acbcad7b4e
reload: use OnRestart (#1709)
* reload: use OnRestart

Close the listener on OnRestart for health and metrics so the default
setup function can setup the listener when the plugin is "starting up".

Lightly test with some SIGUSR1-ing. Also checked the reload plugin with
this, seems fine:

.com.:1043
.:1043
2018/04/20 15:01:25 [INFO] CoreDNS-1.1.1
2018/04/20 15:01:25 [INFO] linux/amd64, go1.10,
CoreDNS-1.1.1
linux/amd64, go1.10,
2018/04/20 15:01:25 [INFO] Running configuration MD5 = aa8b3f03946fb60546ca1f725d482714
2018/04/20 15:02:01 [INFO] Reloading
2018/04/20 15:02:01 [INFO] Running configuration MD5 = b34a96d99e01db4015a892212560155f
2018/04/20 15:02:01 [INFO] Reloading complete
^C2018/04/20 15:02:06 [INFO] SIGINT: Shutting down

With this corefile:
.com {
  proxy . 127.0.0.1:53
  prometheus :9054
  whoami
  reload
}

. {
  proxy . 127.0.0.1:53
  prometheus :9054
  whoami
  reload
}

The prometheus port was 9053, changed that to 54 so reload would pick it
up.

From a cursory look it seems this also fixes:
Fixes #1604 #1618 #1686 #1492

* At least make it test

* Use onfinalshutdown

* reload: add reload test

This test #1604 adn right now fails.

* Address review comments

* Add bug section explaining things a bit

* compile tests

* Fix tests

* fixes

* slightly less crazy

* try to make prometheus setup less confusing

* Use ephermal port for test

* Don't use the listener

* These are shared between goroutines, just use the boolean in the main
  structure.
* Fix text in the reload README,
* Set addr to TODO once stopping it
* Morph fturb's comment into test, to test reload and scrape health and
  metric endpoint
2018-04-21 17:43:02 +01:00
..
auto global: move to context (#1699) 2018-04-20 11:01:06 +01:00
autopath global: move to context (#1699) 2018-04-20 11:01:06 +01:00
bind just use setup (#1574) 2018-02-28 19:56:14 -08:00
cache global: move to context (#1699) 2018-04-20 11:01:06 +01:00
chaos global: move to context (#1699) 2018-04-20 11:01:06 +01:00
debug Update all plugins to use plugin/pkg/log (#1694) 2018-04-19 07:41:56 +01:00
deprecated plugin/deprecated: add an easy way to error on deprecated plugin (#1575) 2018-03-01 06:49:52 -08:00
dnssec global: move to context (#1699) 2018-04-20 11:01:06 +01:00
dnstap global: move to context (#1699) 2018-04-20 11:01:06 +01:00
erratic global: move to context (#1699) 2018-04-20 11:01:06 +01:00
errors global: move to context (#1699) 2018-04-20 11:01:06 +01:00
etcd global: move to context (#1699) 2018-04-20 11:01:06 +01:00
federation global: move to context (#1699) 2018-04-20 11:01:06 +01:00
file global: move to context (#1699) 2018-04-20 11:01:06 +01:00
forward plugin/forward: gracefull stop (#1701) 2018-04-20 17:47:46 +03:00
health reload: use OnRestart (#1709) 2018-04-21 17:43:02 +01:00
hosts global: move to context (#1699) 2018-04-20 11:01:06 +01:00
kubernetes global: move to context (#1699) 2018-04-20 11:01:06 +01:00
loadbalance global: move to context (#1699) 2018-04-20 11:01:06 +01:00
log global: move to context (#1699) 2018-04-20 11:01:06 +01:00
metrics reload: use OnRestart (#1709) 2018-04-21 17:43:02 +01:00
nsid global: move to context (#1699) 2018-04-20 11:01:06 +01:00
pkg global: move to context (#1699) 2018-04-20 11:01:06 +01:00
pprof Update all plugins to use plugin/pkg/log (#1694) 2018-04-19 07:41:56 +01:00
proxy global: move to context (#1699) 2018-04-20 11:01:06 +01:00
reload reload: use OnRestart (#1709) 2018-04-21 17:43:02 +01:00
reverse global: move to context (#1699) 2018-04-20 11:01:06 +01:00
rewrite global: move to context (#1699) 2018-04-20 11:01:06 +01:00
root Update all plugins to use plugin/pkg/log (#1694) 2018-04-19 07:41:56 +01:00
route53 global: move to context (#1699) 2018-04-20 11:01:06 +01:00
secondary plugin/auto/file/secondary: Use new upstream resolver (#1534) 2018-02-16 09:44:50 +01:00
template global: move to context (#1699) 2018-04-20 11:01:06 +01:00
test global: move to context (#1699) 2018-04-20 11:01:06 +01:00
tls Update all plugins to use plugin/pkg/log (#1694) 2018-04-19 07:41:56 +01:00
trace global: move to context (#1699) 2018-04-20 11:01:06 +01:00
whoami global: move to context (#1699) 2018-04-20 11:01:06 +01:00
backend.go global: move to context (#1699) 2018-04-20 11:01:06 +01:00
backend_lookup.go plugin/{kubernetes/etcd}: dynamic SOA (#1188) 2017-11-01 10:11:34 +00:00
normalize.go fix computation of reverse zone based on Ipv6 CIDRs (#1415) 2018-01-23 15:58:36 +00:00
normalize_test.go CIDR query routing (#1159) 2017-10-24 10:16:03 +01:00
plugin.go global: move to context (#1699) 2018-04-20 11:01:06 +01:00