aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2019-09-20 08:02:30 +0100
committerGravatar GitHub <noreply@github.com> 2019-09-20 08:02:30 +0100
commit004c5fca9d7dfb8b58d608e4d50833b40953441f (patch)
tree933985820e2584cea1cb8a4ca8fb4fcd903d8f81 /plugin/kubernetes
parent85e65702bd5b02c0ced5be51e02860c5ae9321aa (diff)
downloadcoredns-004c5fca9d7dfb8b58d608e4d50833b40953441f.tar.gz
coredns-004c5fca9d7dfb8b58d608e4d50833b40953441f.tar.zst
coredns-004c5fca9d7dfb8b58d608e4d50833b40953441f.zip
all: simply registering plugins (#3287)
Abstract the caddy call and make it simpler. See #3261 for some part of the discussion. Go from: ~~~ go func init() { caddy.RegisterPlugin("any", caddy.Plugin{ ServerType: "dns", Action: setup, }) } ~~~ To: ~~~ go func init() { plugin.Register("any", setup) } ~~~ This requires some external documents in coredns.io to be updated as well; the old way still works, so it's backwards compatible. Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/kubernetes')
-rw-r--r--plugin/kubernetes/setup.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/plugin/kubernetes/setup.go b/plugin/kubernetes/setup.go
index 1309139d7..63d85fee9 100644
--- a/plugin/kubernetes/setup.go
+++ b/plugin/kubernetes/setup.go
@@ -34,12 +34,7 @@ import (
var log = clog.NewWithPlugin("kubernetes")
-func init() {
- caddy.RegisterPlugin("kubernetes", caddy.Plugin{
- ServerType: "dns",
- Action: setup,
- })
-}
+func init() { plugin.Register("kubernetes", setup) }
func setup(c *caddy.Controller) error {
klog.SetOutput(os.Stdout)