mw/autopath: correct type for type switch (#1029)

* mw/autopath: correct type for type switch

Use pointer to kubernetes as that is what is registered. Fix up
federation which had the same mistake.

* here
This commit is contained in:
Miek Gieben
2017-09-06 23:28:41 +01:00
committed by Chris O'Haver
parent c514197d6b
commit 9528777fc5
2 changed files with 3 additions and 4 deletions

View File

@@ -28,12 +28,11 @@ func setup(c *caddy.Controller) error {
// Do this in OnStartup, so all middleware has been initialized.
c.OnStartup(func() error {
// TODO(miek): fabricate test to proof this is not thread safe.
m := dnsserver.GetConfig(c).Handler(mw)
if m == nil {
return nil
}
if x, ok := m.(kubernetes.Kubernetes); ok {
if x, ok := m.(*kubernetes.Kubernetes); ok {
ap.searchFunc = x.AutoPath
}
if x, ok := m.(*erratic.Erratic); ok {