From 146e0f9cc3b9c7ca9cb9dd0eba12de2270ae6faf Mon Sep 17 00:00:00 2001 From: hzliangbin Date: Thu, 21 May 2020 18:00:16 +0800 Subject: [PATCH] add kind_sorter support for SecretList Signed-off-by: Bin Liang --- pkg/releaseutil/kind_sorter.go | 2 ++ pkg/releaseutil/kind_sorter_test.go | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/releaseutil/kind_sorter.go b/pkg/releaseutil/kind_sorter.go index 5b131b3b0..a340dfc29 100644 --- a/pkg/releaseutil/kind_sorter.go +++ b/pkg/releaseutil/kind_sorter.go @@ -37,6 +37,7 @@ var InstallOrder KindSortOrder = []string{ "PodDisruptionBudget", "ServiceAccount", "Secret", + "SecretList", "ConfigMap", "StorageClass", "PersistentVolume", @@ -93,6 +94,7 @@ var UninstallOrder KindSortOrder = []string{ "PersistentVolume", "StorageClass", "ConfigMap", + "SecretList", "Secret", "ServiceAccount", "PodDisruptionBudget", diff --git a/pkg/releaseutil/kind_sorter_test.go b/pkg/releaseutil/kind_sorter_test.go index 341f528a0..71d355210 100644 --- a/pkg/releaseutil/kind_sorter_test.go +++ b/pkg/releaseutil/kind_sorter_test.go @@ -25,6 +25,10 @@ import ( func TestKindSorter(t *testing.T) { manifests := []Manifest{ + { + Name: "E", + Head: &SimpleHead{Kind: "SecretList"}, + }, { Name: "i", Head: &SimpleHead{Kind: "ClusterRole"}, @@ -168,8 +172,8 @@ func TestKindSorter(t *testing.T) { order KindSortOrder expected string }{ - {"install", InstallOrder, "aAbcC3def1gh2iIjJkKlLmnopqrxstuvw!"}, - {"uninstall", UninstallOrder, "wvmutsxrqponLlKkJjIi2hg1fed3CcbAa!"}, + {"install", InstallOrder, "aAbcC3deEf1gh2iIjJkKlLmnopqrxstuvw!"}, + {"uninstall", UninstallOrder, "wvmutsxrqponLlKkJjIi2hg1fEed3CcbAa!"}, } { var buf bytes.Buffer t.Run(test.description, func(t *testing.T) {