Browse Source

add postrenderer pull secrets check

Alexander Belanger 5 năm trước cách đây
mục cha
commit
04f600b4c8
1 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 5 5
      internal/helm/postrenderer.go

+ 5 - 5
internal/helm/postrenderer.go

@@ -268,13 +268,13 @@ func (d *DockerSecretsPostRenderer) updatePodSpecs(secrets map[string]string) {
 
 		imagePullSecrets := make([]map[string]interface{}, 0)
 
-		existingNames := map[string]bool{}
 		if existingPullSecrets, ok := podSpec["imagePullSecrets"]; ok {
-			imagePullSecrets = existingPullSecrets.([]map[string]interface{})
-			for _, s := range imagePullSecrets {
+			existing := existingPullSecrets.([]map[string]interface{})
+
+			for _, s := range existing {
 				if name, ok := s["name"]; ok {
-					if n, ok := name.(string); ok {
-						existingNames[n] = true
+					if n, ok := name.(string); ok && n != "" {
+						imagePullSecrets = append(imagePullSecrets, s)
 					}
 				}
 			}