diff --git a/charts/argocd-apps/templates/applications.yaml b/charts/argocd-apps/templates/applications.yaml index 48136179..acd147a8 100644 --- a/charts/argocd-apps/templates/applications.yaml +++ b/charts/argocd-apps/templates/applications.yaml @@ -48,20 +48,4 @@ spec: info: {{- toYaml . | nindent 4 }} {{- end }} -{{- end }} - -{{- range .Values.itemTemplates }} -{{- if kindIs "string" .template }} -{{- $template := .template -}} -{{- range .items }} ---- -{{ tpl $template (set . "Template" $.Template) }} -{{- end }} -{{- else }} -{{- $template := .template | toYaml -}} -{{- range .items }} ---- -{{ tpl $template (set . "Template" $.Template) }} -{{- end }} -{{- end }} {{- end }} \ No newline at end of file diff --git a/charts/argocd-apps/templates/item-templates.yaml b/charts/argocd-apps/templates/item-templates.yaml new file mode 100644 index 00000000..a209cc2a --- /dev/null +++ b/charts/argocd-apps/templates/item-templates.yaml @@ -0,0 +1,15 @@ +{{- range .Values.itemTemplates }} +{{- if kindIs "string" .template }} +{{- $template := .template -}} +{{- range .items }} +--- +{{ tpl $template (set . "Template" $.Template) }} +{{- end }} +{{- else }} +{{- $template := .template | toYaml -}} +{{- range .items }} +--- +{{ tpl $template (set . "Template" $.Template) }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file