Repository: helm/helm (go)

Issue:
Add kind_sorter support for SecretList
Normally you can define multiple secrets in a single Secret manifest. However if you want a TLS secret then you can only have one TLS secret in the secret manifest.
Using a SecretList I can create a templates that would take an array of TLS secrets.
Unfortunately the SecretList is not part of the sort order and will be added after other manifest are installed that refer to my secrets in the secretlist.


Output of `helm version`:
version.BuildInfo{Version:"v3.2.0-rc.1", GitCommit:"7bffac813db894e06d17bac91d14ea819b5c2310", GitTreeState:"clean", GoVersion:"go1.13.10"}

Output of `kubectl version`:
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:16:51Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:50:46Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.): Minikube




Pull request description:
add kind_sorter support for SecretList
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. Make sure to read the Contributing Guide before submitting your PR: https://github.com/helm/helm/blob/master/CONTRIBUTING.md
2. If this PR closes another issue, add 'closes #<issue number>' somewhere in the PR summary. GitHub will automatically close that issue when this PR gets merged. Alternatively, adding 'refs #<issue number>' will not close the issue, but help provide the reviewer more context.-->

**What this PR does / why we need it**:
add kind_sorter support for SecretList

Fix #8173

**Special notes for your reviewer**:

**If applicable**:
- [ ] this PR contains documentation
- [x] this PR contains unit tests
- [ ] this PR has been tested for backwards compatibility

Signed-off-by: Bin Liang hzliangbin@foxmail.com


Patch:
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",


Test patch:
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) {