mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 02:33:21 -05:00 
			
		
		
		
	* Implement deprecation notice for 1.1.4 This still allows all the config to be parsed, but noops it: * -log; always set the log to stdout; no matter what. * https_google; removed from the proxy implementation. * reverse plugin: set to deprecated. * Whole of reverse can go * Remove test for deprecated plugin
		
			
				
	
	
		
			39 lines
		
	
	
		
			914 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			914 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Package deprecated is used when we deprecated plugin. In plugin.cfg just go from
 | 
						|
//
 | 
						|
// startup:github.com/mholt/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/mholt/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,
 | 
						|
		})
 | 
						|
	}
 | 
						|
}
 |