Skip to content

Commit

Permalink
Create seperate services, iocs maps
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelldls committed Sep 30, 2024
1 parent 8b1a6d7 commit e100dce
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Charts/argocd-apps/templates/_apps.tpl
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{{- define "ec-helm-charts.argocd-apps" -}}
{{- $currentScope := . -}}
{{- range $service, $settings := .Values.services }}
{{- range $index, $services := list .Values.iocs .Values.services }}
{{- range $service, $settings := $services }}
{{- /* Make sure settings is an empty dict if it is currently nil */ -}}
{{ $settings := default dict $settings -}}
{{ if ne $settings.removed true }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ $service }}
namespace: {{ $currentScope.Release.Namespace }}
namespace: {{ $.Release.Namespace }}
labels:
ec_service: {{ eq $settings.ec_service true | ternary true false | quote }}
ec_service: {{ eq $index 0 | ternary true false | quote }}
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: {{ default $currentScope.Release.Namespace $currentScope.Values.project }}
project: {{ default $.Release.Namespace $.Values.project }}
destination:
namespace: {{ $currentScope.Values.destination.namespace }}
name: {{ $currentScope.Values.destination.name }}
namespace: {{ $.Values.destination.namespace }}
name: {{ $.Values.destination.name }}
source:
repoURL: {{ default $currentScope.Values.source.repoURL $settings.repoURL }}
repoURL: {{ default $.Values.source.repoURL $settings.repoURL }}
path: services/{{ $service }}
targetRevision: {{ default $currentScope.Values.source.targetRevision $settings.targetRevision }}
targetRevision: {{ default $.Values.source.targetRevision $settings.targetRevision }}
helm:
version: v3
parameters:
Expand All @@ -39,6 +39,7 @@ spec:
- ApplyOutOfSyncOnly=true
- RespectIgnoreDifferences=true
---
{{ end }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

0 comments on commit e100dce

Please sign in to comment.