Skip to content

Make use of tpl-templating for argo-cd.configs.cm.url #3875

Description

@kad-reinda

Describe the bug

I tried to set the url with {{ .Values.global.clusterFqdn }} for ArgoCD (argo-cd.configs.cm.url and argo-cd.server.ingress.hostname) .
This works for the ingressroute, but not for the url.

I fixed this for now by overruling argo-cd.config.cm in my local _helpers.tpl:
{{- define "argo-cd.config.cm" -}}
{{- $config := omit .Values.configs.cm "create" "annotations" -}}
{{- $preset := include "argo-cd.config.cm.presets" . | fromYaml | default dict -}}
{{- range $key, $value := mergeOverwrite $preset $config }}
{{- $fmted := tpl ($value | toString) $ }}
{{- if not (eq $fmted "") }}
{{ $key }}: {{ $fmted | toYaml }}
{{- end }}
{{- end }}
{{- end -}}

Can this be done in original code?

Related helm chart

argo-cd

Helm chart version

9.5.11

To Reproduce

  1. Set global.clusterFqdn to "mynewfqdn.something"
  2. Overrule argo-cd.server.ingress.hostname:
    hostname: "{{ .Values.global.clusterFqdn }}"
    Overrule argo-cd.configs.cm.url
    url: "https://{{ .Values.global.clusterFqdn }}/argocd"
  3. Run helm template . -f ....
  4. See ingress.yaml: spec.rules.host is set to wanted value
    See argocd-cm.yaml: data.url is set to: url: https://{{ .Values.global.clusterFqdn }}/argocd
  5. Make change to _helpers.tpl
  6. See argocd-cm.yaml: data.url is set to: url: https://mynewfqdn.something/argocd

Expected behavior

argocd-cm.yaml: data.url set to: url: https://mynewfqdn.something/argocd

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions