Refactor Helm template to properly handle ApplicationSet namespaces splitting and quoting.

Signed-off-by: leehosu <hosu4549@gmail.com>
This commit is contained in:
leehosu 2024-09-24 16:29:16 +09:00
parent 9f0a20d26c
commit a45d241163
No known key found for this signature in database
GPG key ID: 49693DFDB234F6E4
2 changed files with 8 additions and 7 deletions

View file

@ -13,11 +13,12 @@ subjects:
- kind: ServiceAccount
name: {{ include "argo-cd.controller.serviceAccountName" . }}
namespace: {{ include "argo-cd.namespace" . }}
{{- if .Values.configs.params.applicationsetcontroller.namespaces }}
{{- range (split "," .Values.configs.params.applicationsetcontroller.namespaces) }}
{{- $namespaces := index .Values.configs.params "applicationsetcontroller.namespaces" -}}
{{- range $namespace := (split "," $namespaces) }}
{{- if $namespaces }}
- kind: ServiceAccount
name: {{ include "argo-cd.controller.serviceAccountName" $root }}
namespace: {{ . | trim }}
{{- end }}
name: {{ include "argo-cd.controller.serviceAccountName" $ }}
namespace: {{ $namespace | trim | quote }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -279,8 +279,8 @@ configs:
# -- Enables use of the Progressive Syncs capability
applicationsetcontroller.enable.progressive.syncs: false
+ # -- A list of glob patterns specifying where to look for ApplicationSet resources. (e.g. `"namespace1, namespace2"`)
applicationsetcontroller.namespaces: ""
# -- A list of glob patterns specifying where to look for ApplicationSet resources. (e.g. `"namespace1, namespace2"`)
applicationsetcontroller.namespaces: "namespace1, namespace2"
# -- Enables [Applications in any namespace]
## List of additional namespaces where applications may be created in and reconciled from.