Added NetworkPolicy, PodDisruptionBudget, and PodSecurityPolicy to InstallOrder. (#6624)

Port #6266 #4769 #3899 to Helm 3.

Signed-off-by: Dmitry Tokarev <dm.tokarev@yahoo.com>
pull/6632/head
Dmitry Tokarev 5 years ago committed by Martin Hickey
parent e2d5ec8397
commit 1da0d011f9

@ -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",
}

@ -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) {

Loading…
Cancel
Save