mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 16:54:15 -04:00
core: replace GetMiddleware (#885)
* core: replace GetMiddleware See the discussion in #881. GetMiddleware would add a `nil` middleware to the callstack thereby breaking functionality. This PR drops it in favor of RegisterHandler which is a completely standalone registry for middleware that want to let it self know to other middleware. Currenly *autopath* uses this to call *kubernetes*'s AutoPath method for dynamic autopathing. * Drop GetMiddleware * Register metrics * drop the panic
This commit is contained in:
@@ -51,6 +51,9 @@ func setup(c *caddy.Controller) error {
|
||||
return kubernetes
|
||||
})
|
||||
|
||||
// Also register kubernetes for use in autopath.
|
||||
dnsserver.GetConfig(c).RegisterHandler(kubernetes)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user