mirror of
https://github.com/helm/helm.git
synced 2026-04-15 21:59:50 -04:00
Added NetworkPolicy, PodDisruptionBudget, and PodSecurityPolicy to InstallOrder. (#6624)
Port #6266 #4769 #3899 to Helm 3. Signed-off-by: Dmitry Tokarev <dm.tokarev@yahoo.com>
This commit is contained in:
parent
e2d5ec8397
commit
1da0d011f9
2 changed files with 20 additions and 2 deletions
|
|
@ -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…
Reference in a new issue