fix(argo-cd): Template configuration keys as a string instead of map (#2205)

This commit is contained in:
Petr Drastil 2023-08-05 12:16:40 +02:00 committed by GitHub
parent 962342fe2a
commit f0ac0b7cf4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 20 deletions

View file

@ -3,7 +3,7 @@ appVersion: v2.7.10
kubeVersion: ">=1.23.0-0" kubeVersion: ">=1.23.0-0"
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes. description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd name: argo-cd
version: 5.42.1 version: 5.42.2
home: https://github.com/argoproj/argo-helm home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
sources: sources:
@ -26,5 +26,5 @@ annotations:
fingerprint: 2B8F22F57260EFA67BE1C5824B11F800CD9D2252 fingerprint: 2B8F22F57260EFA67BE1C5824B11F800CD9D2252
url: https://argoproj.github.io/argo-helm/pgp_keys.asc url: https://argoproj.github.io/argo-helm/pgp_keys.asc
artifacthub.io/changes: | artifacthub.io/changes: |
- kind: changed - kind: fixed
description: Upgrade Argo CD to v2.7.10 description: Templates for global presets properly renders keys as a string instead of map

View file

@ -162,9 +162,11 @@ Create the name of the notifications service account to use
Argo Configuration Preset Values (Incluenced by Values configuration) Argo Configuration Preset Values (Incluenced by Values configuration)
*/}} */}}
{{- define "argo-cd.config.cm.presets" -}} {{- define "argo-cd.config.cm.presets" -}}
{{- $presets := dict -}}
{{- if .Values.configs.styles -}} {{- if .Values.configs.styles -}}
ui.cssurl: "./custom/custom.styles.css" {{- $_ := set $presets "ui.cssurl" "./custom/custom.styles.css" -}}
{{- end -}} {{- end -}}
{{- toYaml $presets }}
{{- end -}} {{- end -}}
{{/* {{/*
@ -183,24 +185,25 @@ Merge Argo Configuration with Preset Configuration
{{/* {{/*
Argo Params Default Configuration Presets Argo Params Default Configuration Presets
NOTE: Configuration keys must be stored as dict because YAML treats dot as separator
*/}} */}}
{{- define "argo-cd.config.params.presets" -}} {{- define "argo-cd.config.params.presets" -}}
repo.server: "{{ include "argo-cd.repoServer.fullname" . }}:{{ .Values.repoServer.service.port }}" {{- $presets := dict -}}
server.repo.server.strict.tls: {{ .Values.repoServer.certificateSecret.enabled | toString }} {{- $_ := set $presets "repo.server" (printf "%s:%s" (include "argo-cd.repoServer.fullname" .) (.Values.repoServer.service.port | toString)) -}}
{{- with include "argo-cd.redis.server" . }} {{- $_ := set $presets "server.repo.server.strict.tls" (.Values.repoServer.certificateSecret.enabled | toString ) -}}
redis.server: {{ . | quote }} {{- $_ := set $presets "redis.server" (include "argo-cd.redis.server" .) -}}
{{- end }} {{- if .Values.dex.enabled -}}
{{- if .Values.dex.enabled }} {{- $_ := set $presets "server.dex.server" (include "argo-cd.dex.server" .) -}}
server.dex.server: {{ include "argo-cd.dex.server" . | quote }} {{- $_ := set $presets "server.dex.server.strict.tls" .Values.dex.certificateSecret.enabled -}}
server.dex.server.strict.tls: {{ .Values.dex.certificateSecret.enabled | toString }} {{- end -}}
{{- end }} {{- range $component := tuple "applicationsetcontroller" "controller" "server" "reposerver" -}}
{{- range $component := tuple "applicationsetcontroller" "controller" "server" "reposerver" }} {{- $_ := set $presets (printf "%s.log.format" $component) $.Values.global.logging.format -}}
{{ $component }}.log.format: {{ $.Values.global.logging.format | quote }} {{- $_ := set $presets (printf "%s.log.format" $component) $.Values.global.logging.format -}}
{{ $component }}.log.level: {{ $.Values.global.logging.level | quote }} {{- end -}}
{{- end }} {{- if .Values.applicationSet.enabled -}}
{{- if .Values.applicationSet.enabled }} {{- $_ := set $presets "applicationsetcontroller.enable.leader.election" (gt (.Values.applicationSet.replicaCount | int64) 1) -}}
applicationsetcontroller.enable.leader.election: {{ gt (.Values.applicationSet.replicaCount | int64) 1 }} {{- end -}}
{{- end }} {{- toYaml $presets }}
{{- end -}} {{- end -}}
{{/* {{/*