diff --git a/pkg/releaseutil/kind_sorter.go b/pkg/releaseutil/kind_sorter.go index b1b2c58db..a5110a100 100644 --- a/pkg/releaseutil/kind_sorter.go +++ b/pkg/releaseutil/kind_sorter.go @@ -26,8 +26,11 @@ type KindSortOrder []string // Those occurring earlier in the list get installed before those occurring later in the list. var InstallOrder KindSortOrder = []string{ "Namespace", + "NetworkPolicy", "ResourceQuota", "LimitRange", + "PodSecurityPolicy", + "PodDisruptionBudget", "Secret", "ConfigMap", "StorageClass", @@ -88,8 +91,11 @@ var UninstallOrder KindSortOrder = []string{ "StorageClass", "ConfigMap", "Secret", + "PodDisruptionBudget", + "PodSecurityPolicy", "LimitRange", "ResourceQuota", + "NetworkPolicy", "Namespace", } diff --git a/pkg/releaseutil/kind_sorter_test.go b/pkg/releaseutil/kind_sorter_test.go index cfaa3a771..93d8ae782 100644 --- a/pkg/releaseutil/kind_sorter_test.go +++ b/pkg/releaseutil/kind_sorter_test.go @@ -79,6 +79,10 @@ func TestKindSorter(t *testing.T) { Name: "a", Head: &SimpleHead{Kind: "Namespace"}, }, + { + Name: "A", + Head: &SimpleHead{Kind: "NetworkPolicy"}, + }, { Name: "f", Head: &SimpleHead{Kind: "PersistentVolume"}, @@ -91,6 +95,14 @@ func TestKindSorter(t *testing.T) { Name: "o", Head: &SimpleHead{Kind: "Pod"}, }, + { + Name: "3", + Head: &SimpleHead{Kind: "PodDisruptionBudget"}, + }, + { + Name: "C", + Head: &SimpleHead{Kind: "PodSecurityPolicy"}, + }, { Name: "q", Head: &SimpleHead{Kind: "ReplicaSet"}, @@ -154,8 +166,8 @@ func TestKindSorter(t *testing.T) { order KindSortOrder expected string }{ - {"install", InstallOrder, "abcde1fgh2iIjJkKlLmnopqrxstuvw!"}, - {"uninstall", UninstallOrder, "wvmutsxrqponLlKkJjIi2hgf1edcba!"}, + {"install", InstallOrder, "aAbcC3de1fgh2iIjJkKlLmnopqrxstuvw!"}, + {"uninstall", UninstallOrder, "wvmutsxrqponLlKkJjIi2hgf1ed3CcbAa!"}, } { var buf bytes.Buffer t.Run(test.description, func(t *testing.T) {