Merge pull request #6100 from sebosp/v3-list-mode-install-order

Added List mode for Role, ClusterRole and Bindings
pull/6106/head
Martin Hickey 5 years ago committed by GitHub
commit bdb57491bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,9 +36,13 @@ var InstallOrder KindSortOrder = []string{
"ServiceAccount",
"CustomResourceDefinition",
"ClusterRole",
"ClusterRoleList",
"ClusterRoleBinding",
"ClusterRoleBindingList",
"Role",
"RoleList",
"RoleBinding",
"RoleBindingList",
"Service",
"DaemonSet",
"Pod",
@ -69,9 +73,13 @@ var UninstallOrder KindSortOrder = []string{
"ReplicationController",
"Pod",
"DaemonSet",
"RoleBindingList",
"RoleBinding",
"RoleList",
"Role",
"ClusterRoleBindingList",
"ClusterRoleBinding",
"ClusterRoleList",
"ClusterRole",
"CustomResourceDefinition",
"ServiceAccount",

@ -27,10 +27,18 @@ func TestKindSorter(t *testing.T) {
Name: "i",
Head: &SimpleHead{Kind: "ClusterRole"},
},
{
Name: "I",
Head: &SimpleHead{Kind: "ClusterRoleList"},
},
{
Name: "j",
Head: &SimpleHead{Kind: "ClusterRoleBinding"},
},
{
Name: "J",
Head: &SimpleHead{Kind: "ClusterRoleBindingList"},
},
{
Name: "e",
Head: &SimpleHead{Kind: "ConfigMap"},
@ -99,10 +107,18 @@ func TestKindSorter(t *testing.T) {
Name: "k",
Head: &SimpleHead{Kind: "Role"},
},
{
Name: "K",
Head: &SimpleHead{Kind: "RoleList"},
},
{
Name: "l",
Head: &SimpleHead{Kind: "RoleBinding"},
},
{
Name: "L",
Head: &SimpleHead{Kind: "RoleBindingList"},
},
{
Name: "d",
Head: &SimpleHead{Kind: "Secret"},
@ -138,8 +154,8 @@ func TestKindSorter(t *testing.T) {
order KindSortOrder
expected string
}{
{"install", InstallOrder, "abcde1fgh2ijklmnopqrxstuvw!"},
{"uninstall", UninstallOrder, "wvmutsxrqponlkji2hgf1edcba!"},
{"install", InstallOrder, "abcde1fgh2iIjJkKlLmnopqrxstuvw!"},
{"uninstall", UninstallOrder, "wvmutsxrqponLlKkJjIi2hgf1edcba!"},
} {
var buf bytes.Buffer
t.Run(test.description, func(t *testing.T) {

Loading…
Cancel
Save