fix(tiller): correctly sort PodDisruptionBudget objects before pods that might use them (#4769)

Signed-off-by: Matt Tucker <ultimateboy@gmail.com>
pull/4771/head
Matt Tucker 6 years ago committed by Matt Butcher
parent 26c88ec815
commit 147c8217c7

@ -31,6 +31,7 @@ var InstallOrder SortOrder = []string{
"ResourceQuota",
"LimitRange",
"PodSecurityPolicy",
"PodDisruptionBudget",
"Secret",
"ConfigMap",
"StorageClass",
@ -81,6 +82,7 @@ var UninstallOrder SortOrder = []string{
"StorageClass",
"ConfigMap",
"Secret",
"PodDisruptionBudget",
"PodSecurityPolicy",
"LimitRange",
"ResourceQuota",

@ -133,6 +133,10 @@ func TestKindSorter(t *testing.T) {
Name: "w",
Head: &util.SimpleHead{Kind: "APIService"},
},
{
Name: "z",
Head: &util.SimpleHead{Kind: "PodDisruptionBudget"},
},
}
for _, test := range []struct {
@ -140,8 +144,8 @@ func TestKindSorter(t *testing.T) {
order SortOrder
expected string
}{
{"install", InstallOrder, "abc3de1fgh2ijklmnopqrstuvw!"},
{"uninstall", UninstallOrder, "wvmutsrqponlkji2hgf1ed3cba!"},
{"install", InstallOrder, "abc3zde1fgh2ijklmnopqrstuvw!"},
{"uninstall", UninstallOrder, "wvmutsrqponlkji2hgf1edz3cba!"},
} {
var buf bytes.Buffer
t.Run(test.description, func(t *testing.T) {

Loading…
Cancel
Save