coredns/plugin/deprecated/setup.go
Yong Tang f8bba51f84
Update Caddy to 1.0.1, and update import path (#2961)
* Update Caddy to 1.0.1, and update import path

This fix updates caddy to 1.0.1 and also
updates the import path to github.com/caddyserver/caddy

This fix fixes 2959

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Also update plugin.cfg

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Update and bump zplugin.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-03 09:04:47 +08:00

38 lines
926 B
Go

// Package deprecated is used when we deprecated plugin. In plugin.cfg just go from
//
// startup:github.com/caddyserver/caddy/startupshutdown
//
// To:
//
// startup:deprecated
//
// And things should work as expected. This means starting CoreDNS will fail with an error. We can only
// point to the release notes to details what next steps a user should take. I.e. there is no way to add this
// to the error generated.
package deprecated
import (
"errors"
"github.com/coredns/coredns/plugin"
"github.com/caddyserver/caddy"
)
// removed has the names of the plugins that need to error on startup.
var removed = []string{"reverse"}
func setup(c *caddy.Controller) error {
c.Next()
x := c.Val()
return plugin.Error(x, errors.New("this plugin has been deprecated"))
}
func init() {
for _, plugin := range removed {
caddy.RegisterPlugin(plugin, caddy.Plugin{
ServerType: "dns",
Action: setup,
})
}
}