mirror of
https://github.com/notherealmarco/coredns-deployment.git
synced 2025-05-05 20:42:33 +02:00
k8s migration: add handler for multi proxy to forward (#164)
add global postprocess and handler for multi proxy to forward
This commit is contained in:
parent
709b136563
commit
d7f87ddf2a
4 changed files with 129 additions and 15 deletions
|
@ -1,6 +1,7 @@
|
|||
package migration
|
||||
|
||||
import (
|
||||
"github.com/andreyvit/diff"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -130,6 +131,59 @@ func TestMigrate(t *testing.T) {
|
|||
loop
|
||||
ready
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "handle multiple proxy plugins",
|
||||
fromVersion: "1.1.3",
|
||||
toVersion: "1.5.0",
|
||||
deprecations: true,
|
||||
startCorefile: `.:53 {
|
||||
errors
|
||||
health
|
||||
kubernetes cluster.local in-addr.arpa ip6.arpa {
|
||||
pods insecure
|
||||
upstream
|
||||
fallthrough in-addr.arpa ip6.arpa
|
||||
}
|
||||
prometheus :9153
|
||||
proxy mystub-1.example.org 1.2.3.4
|
||||
proxy mystub-2.example.org 5.6.7.8
|
||||
proxy . /etc/resolv.conf
|
||||
cache 30
|
||||
reload
|
||||
loadbalance
|
||||
}
|
||||
`,
|
||||
expectedCorefile: `.:53 {
|
||||
errors
|
||||
health
|
||||
kubernetes cluster.local in-addr.arpa ip6.arpa {
|
||||
pods insecure
|
||||
fallthrough in-addr.arpa ip6.arpa
|
||||
}
|
||||
prometheus :9153
|
||||
forward . /etc/resolv.conf
|
||||
cache 30
|
||||
reload
|
||||
loadbalance
|
||||
loop
|
||||
ready
|
||||
}
|
||||
|
||||
mystub-1.example.org {
|
||||
forward . 1.2.3.4
|
||||
loop
|
||||
errors
|
||||
cache 30
|
||||
}
|
||||
|
||||
mystub-2.example.org {
|
||||
forward . 5.6.7.8
|
||||
loop
|
||||
errors
|
||||
cache 30
|
||||
}
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
@ -144,7 +198,7 @@ func TestMigrate(t *testing.T) {
|
|||
}
|
||||
|
||||
if result != testCase.expectedCorefile {
|
||||
t.Errorf("expected %v; got %v", testCase.expectedCorefile, result)
|
||||
t.Errorf("expected -> got diffs:\n%v", diff.LineDiff(testCase.expectedCorefile, result))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue