handle endpoint deprecation (#141)

This commit is contained in:
Chris O'Haver 2019-04-09 14:13:56 -04:00 committed by GitHub
parent b5043b3b75
commit 56bee8655c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,7 +62,10 @@ var Versions = map[string]release{
status: deprecated, status: deprecated,
action: removeOption, action: removeOption,
}, },
"endpoint": {}, "endpoint": {
status: deprecated,
action: removeExtraEndpoints,
},
"tls": {}, "tls": {},
"kubeconfig": {}, "kubeconfig": {},
"namespaces": {}, "namespaces": {},
@ -116,7 +119,10 @@ var Versions = map[string]release{
"kubernetes": { "kubernetes": {
options: map[string]option{ options: map[string]option{
"resyncperiod": {}, "resyncperiod": {},
"endpoint": {}, // TODO: Multiple endpoint deprecation "endpoint": {
status: deprecated,
action: removeExtraEndpoints,
},
"tls": {}, "tls": {},
"kubeconfig": {}, "kubeconfig": {},
"namespaces": {}, "namespaces": {},
@ -190,7 +196,10 @@ var Versions = map[string]release{
"kubernetes": { "kubernetes": {
options: map[string]option{ options: map[string]option{
"resyncperiod": {}, "resyncperiod": {},
"endpoint": {}, // TODO: Multiple endpoint deprecation "endpoint": {
status: deprecated,
action: removeExtraEndpoints,
},
"tls": {}, "tls": {},
"kubeconfig": {}, "kubeconfig": {},
"namespaces": {}, "namespaces": {},
@ -255,4 +264,14 @@ var proxyToForwardOptionsMigrations = map[string]option{
}, },
} }
var proxyToForwardPluginAction = func(p *corefile.Plugin) (*corefile.Plugin, error) { return renamePlugin(p, "forward") } var proxyToForwardPluginAction = func(p *corefile.Plugin) (*corefile.Plugin, error) {
return renamePlugin(p, "forward")
}
var removeExtraEndpoints = func(o *corefile.Option) (*corefile.Option, error) {
if len(o.Args) > 1 {
o.Args = o.Args[:1]
return o, nil
}
return nil, nil
}