{{- $namespace := .Values.argo_namespace -}} {{- $chart_name := include "argo-cd.name" . -}} {{- $chart := include "argo-cd.chart" . -}} {{- range .Values.applications }} apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: {{ .name }} namespace: {{ $namespace }} labels: app.kubernetes.io/name: {{ $chart_name }} helm.sh/chart: {{ $chart }} app.kubernetes.io/instance: {{ $.Release.Name }} app.kubernetes.io/managed-by: {{ $.Release.Service }} app.kubernetes.io/part-of: {{ $chart_name }} spec: project: {{ .project }} source: repoURL: {{ .git.url }} targetRevision: {{ .git.branch }} path: {{ .git.path }} helm: valueFiles: {{ toYaml .value_files | indent 6 }} destination: server: {{ .destination.server | default "https://kubernetes.default.svc"}} namespace: {{ .destination.namespace }} --- {{- end }}