mirror of
https://github.com/coredns/coredns.git
synced 2025-12-07 02:45:11 -05:00
core: hide registerHandler (#964)
* core: hide registerHandler Remove RegisterHandler and just make it implicit when we look at the handler compilation step. * Rename GetHandler to just Handler Update callers and make auto check Hander in OnStartup. * Up test coverage in erratic * up test coverage
This commit is contained in:
@@ -29,7 +29,7 @@ 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).GetHandler(mw)
|
||||
m := dnsserver.GetConfig(c).Handler(mw)
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -50,8 +50,7 @@ func setup(c *caddy.Controller) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// allowedMiddleware has a list of middleware that can be used by autopath. For this to work, they
|
||||
// need to register themselves with dnsserver.RegisterHandler.
|
||||
// allowedMiddleware has a list of middleware that can be used by autopath.
|
||||
var allowedMiddleware = map[string]bool{
|
||||
"@kubernetes": true,
|
||||
"@erratic": true,
|
||||
|
||||
Reference in New Issue
Block a user