mirror of
https://github.com/notherealmarco/coredns-deployment.git
synced 2025-05-05 20:42:33 +02:00
kubernetes/migration: dont error out on no-op same-verison upgrades (#171)
* dont error out on no-op same-verison upgrades * test case fixes
This commit is contained in:
parent
9fd69a4c0b
commit
487cb8878d
2 changed files with 57 additions and 3 deletions
|
@ -184,6 +184,44 @@ mystub-2.example.org {
|
|||
errors
|
||||
cache 30
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "no-op same version migration",
|
||||
fromVersion: "1.3.1",
|
||||
toVersion: "1.3.1",
|
||||
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 . /etc/resolv.conf
|
||||
cache 30
|
||||
loop
|
||||
reload
|
||||
loadbalance
|
||||
}
|
||||
`,
|
||||
expectedCorefile: `.:53 {
|
||||
errors
|
||||
health
|
||||
kubernetes cluster.local in-addr.arpa ip6.arpa {
|
||||
pods insecure
|
||||
upstream
|
||||
fallthrough in-addr.arpa ip6.arpa
|
||||
}
|
||||
prometheus :9153
|
||||
proxy . /etc/resolv.conf
|
||||
cache 30
|
||||
loop
|
||||
reload
|
||||
loadbalance
|
||||
}
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
@ -245,6 +283,15 @@ func TestDeprecated(t *testing.T) {
|
|||
t.Errorf("expected to get '%v'; got '%v'", dep.ToString(), result[i].ToString())
|
||||
}
|
||||
}
|
||||
|
||||
result, err = Deprecated("1.3.1", "1.3.1", startCorefile)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
expected = []Notice{}
|
||||
if len(result) != len(expected) {
|
||||
t.Fatalf("expected to find %v notifications in no-op upgrade; got %v", len(expected), len(result))
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnsupported(t *testing.T) {
|
||||
|
@ -377,6 +424,7 @@ func TestValidateVersions(t *testing.T) {
|
|||
to string
|
||||
shouldErr bool
|
||||
}{
|
||||
{"1.3.1", "1.3.1", true},
|
||||
{"1.3.1", "1.5.0", false},
|
||||
{"1.5.0", "1.3.1", true},
|
||||
{"banana", "1.5.0", true},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue