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", "ResourceQuota",
"LimitRange", "LimitRange",
"PodSecurityPolicy", "PodSecurityPolicy",
"PodDisruptionBudget",
"Secret", "Secret",
"ConfigMap", "ConfigMap",
"StorageClass", "StorageClass",
@ -81,6 +82,7 @@ var UninstallOrder SortOrder = []string{
"StorageClass", "StorageClass",
"ConfigMap", "ConfigMap",
"Secret", "Secret",
"PodDisruptionBudget",
"PodSecurityPolicy", "PodSecurityPolicy",
"LimitRange", "LimitRange",
"ResourceQuota", "ResourceQuota",

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

Loading…
Cancel
Save