diff options
author | 2017-08-18 12:57:23 +0100 | |
---|---|---|
committer | 2017-08-18 12:57:23 +0100 | |
commit | cc4e4a0626bf8881e2ae8b2c1e52e09c6308e74e (patch) | |
tree | b1124a42abe78eff2b7944b2b65895522133b61c /middleware/autopath/setup.go | |
parent | 5a1875120cceeaa90f065a4fa7dccffb8c535a71 (diff) | |
download | coredns-cc4e4a0626bf8881e2ae8b2c1e52e09c6308e74e.tar.gz coredns-cc4e4a0626bf8881e2ae8b2c1e52e09c6308e74e.tar.zst coredns-cc4e4a0626bf8881e2ae8b2c1e52e09c6308e74e.zip |
mw/autopath: integration test with erratic (#930)
Add integration test with erratic. For this erratic now also returns an
autopath searchpath. This tests the whole chain; i.e registring a
searchfunction and calling that from autopath.
This tests does a autopathing domain and a non-autopathing one.
Diffstat (limited to 'middleware/autopath/setup.go')
-rw-r--r-- | middleware/autopath/setup.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/middleware/autopath/setup.go b/middleware/autopath/setup.go index 1855dd440..f9b12d98e 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/erratic" "github.com/coredns/coredns/middleware/kubernetes" "github.com/mholt/caddy" @@ -32,8 +33,11 @@ func setup(c *caddy.Controller) error { if m == nil { return nil } - if k, ok := m.(kubernetes.Kubernetes); ok { - ap.searchFunc = k.AutoPath + if x, ok := m.(kubernetes.Kubernetes); ok { + ap.searchFunc = x.AutoPath + } + if x, ok := m.(*erratic.Erratic); ok { + ap.searchFunc = x.AutoPath } return nil }) @@ -50,6 +54,7 @@ func setup(c *caddy.Controller) error { // need to register themselves with dnsserver.RegisterHandler. var allowedMiddleware = map[string]bool{ "@kubernetes": true, + "@erratic": true, } func autoPathParse(c *caddy.Controller) (*AutoPath, string, error) { |