mirror of
https://github.com/notherealmarco/coredns-deployment.git
synced 2025-05-05 12:32:34 +02:00
Fix/rename endpoint migration (#143)
* fix and rename endpoint action to be more general * test
This commit is contained in:
parent
cf59f40250
commit
a464e20ac1
2 changed files with 9 additions and 8 deletions
|
@ -6,10 +6,10 @@ import (
|
||||||
|
|
||||||
func TestMigrate(t *testing.T) {
|
func TestMigrate(t *testing.T) {
|
||||||
startCorefile := `.:53 {
|
startCorefile := `.:53 {
|
||||||
#mycomment
|
|
||||||
errors
|
errors
|
||||||
health
|
health
|
||||||
kubernetes cluster.local in-addr.arpa ip6.arpa {
|
kubernetes cluster.local in-addr.arpa ip6.arpa {
|
||||||
|
endpoint thing1 thing2
|
||||||
pods insecure
|
pods insecure
|
||||||
upstream
|
upstream
|
||||||
fallthrough in-addr.arpa ip6.arpa
|
fallthrough in-addr.arpa ip6.arpa
|
||||||
|
@ -27,6 +27,7 @@ func TestMigrate(t *testing.T) {
|
||||||
errors
|
errors
|
||||||
health
|
health
|
||||||
kubernetes cluster.local in-addr.arpa ip6.arpa {
|
kubernetes cluster.local in-addr.arpa ip6.arpa {
|
||||||
|
endpoint thing1
|
||||||
pods insecure
|
pods insecure
|
||||||
fallthrough in-addr.arpa ip6.arpa
|
fallthrough in-addr.arpa ip6.arpa
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ var Versions = map[string]release{
|
||||||
},
|
},
|
||||||
"endpoint": {
|
"endpoint": {
|
||||||
status: ignored,
|
status: ignored,
|
||||||
action: removeExtraEndpoints,
|
action: useFirstArgumentOnly,
|
||||||
},
|
},
|
||||||
"tls": {},
|
"tls": {},
|
||||||
"kubeconfig": {},
|
"kubeconfig": {},
|
||||||
|
@ -125,7 +125,7 @@ var Versions = map[string]release{
|
||||||
"resyncperiod": {},
|
"resyncperiod": {},
|
||||||
"endpoint": {
|
"endpoint": {
|
||||||
status: ignored,
|
status: ignored,
|
||||||
action: removeExtraEndpoints,
|
action: useFirstArgumentOnly,
|
||||||
},
|
},
|
||||||
"tls": {},
|
"tls": {},
|
||||||
"kubeconfig": {},
|
"kubeconfig": {},
|
||||||
|
@ -202,7 +202,7 @@ var Versions = map[string]release{
|
||||||
"resyncperiod": {},
|
"resyncperiod": {},
|
||||||
"endpoint": {
|
"endpoint": {
|
||||||
status: deprecated,
|
status: deprecated,
|
||||||
action: removeExtraEndpoints,
|
action: useFirstArgumentOnly,
|
||||||
},
|
},
|
||||||
"tls": {},
|
"tls": {},
|
||||||
"kubeconfig": {},
|
"kubeconfig": {},
|
||||||
|
@ -272,10 +272,10 @@ var proxyToForwardPluginAction = func(p *corefile.Plugin) (*corefile.Plugin, err
|
||||||
return renamePlugin(p, "forward")
|
return renamePlugin(p, "forward")
|
||||||
}
|
}
|
||||||
|
|
||||||
var removeExtraEndpoints = func(o *corefile.Option) (*corefile.Option, error) {
|
var useFirstArgumentOnly = func(o *corefile.Option) (*corefile.Option, error) {
|
||||||
if len(o.Args) > 1 {
|
if len(o.Args) < 1 {
|
||||||
o.Args = o.Args[:1]
|
|
||||||
return o, nil
|
return o, nil
|
||||||
}
|
}
|
||||||
return nil, nil
|
o.Args = o.Args[:1]
|
||||||
|
return o, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue