aboutsummaryrefslogtreecommitdiff
path: root/middleware/autopath/setup.go
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/autopath/setup.go')
-rw-r--r--middleware/autopath/setup.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/middleware/autopath/setup.go b/middleware/autopath/setup.go
index 8abd67acb..cbaf007fc 100644
--- a/middleware/autopath/setup.go
+++ b/middleware/autopath/setup.go
@@ -5,6 +5,7 @@ import (
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/middleware"
+ "github.com/coredns/coredns/middleware/kubernetes"
"github.com/mholt/caddy"
"github.com/miekg/dns"
@@ -25,14 +26,14 @@ func setup(c *caddy.Controller) error {
}
c.OnStartup(func() error {
- // So we know for sure the mw is initialized.
+ // Do this in OnStartup, so all middleware has been initialized.
+ // TODO(miek): fabricate test to proof this is not thread safe.
m := dnsserver.GetMiddleware(c, mw)
switch mw {
case "kubernetes":
- m = m
- //if k, ok := m.(kubernetes.Kubernetes); ok {
- //&ap.searchFunc = k.AutoPath
- //}
+ if k, ok := m.(kubernetes.Kubernetes); ok {
+ ap.searchFunc = k.AutoPath
+ }
}
return nil
})