Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit 4583d2b

Browse files
committed
Added gitref counter
1 parent 1270c05 commit 4583d2b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

charts/clustergroup/templates/plumbing/applications.yaml

+12-8
Original file line numberDiff line numberDiff line change
@@ -141,32 +141,36 @@ spec:
141141
project: {{ .project }}
142142

143143
{{- if .sources }}
144+
{{- $refcount := 0 }}
144145
sources:
145-
{{- range .sources }}
146+
{{- range .sources }}
146147
- repoURL: {{ coalesce .repoURL $.Values.global.repoURL }}
147148
targetRevision: {{ coalesce .targetRevision $.Values.global.targetRevision }}
148149
{{- if .chart }}
149150
chart: {{ .chart }}
150151
{{- else if .path }}
151152
path: {{ .path }}
152153
{{- else }}
153-
ref: gitref
154154
{{- end }}
155+
{{- if not (.chart) }}
156+
ref: gitref{{$refcount}}
157+
{{- end }}
158+
{{ $refcount = add1 $refcount }}
155159
{{- if and (not .kustomize) (.chart) }}
156160
helm:
157161
ignoreMissingValueFiles: true
158162
valueFiles:
159-
- "$gitref/values-global.yaml"
160-
- "$gitref/values-{{ $.Values.clusterGroup.name }}.yaml"
163+
- "$gitref{{ $refcount }}/values-global.yaml"
164+
- "$gitref{{ $refcount }}/values-{{ $.Values.clusterGroup.name }}.yaml"
161165
{{- if $.Values.global.clusterPlatform }}
162-
- "$gitref/values-{{ $.Values.global.clusterPlatform }}.yaml"
166+
- "$gitref{{ $refcount }}/values-{{ $.Values.global.clusterPlatform }}.yaml"
163167
{{- if $.Values.global.clusterVersion }}
164-
- "$gitref/values-{{ $.Values.global.clusterPlatform }}-{{ $.Values.global.clusterVersion }}.yaml"
168+
- "$gitref{{ $refcount }}/values-{{ $.Values.global.clusterPlatform }}-{{ $.Values.global.clusterVersion }}.yaml"
165169
{{- end }}
166-
- "$gitref/values-{{ $.Values.global.clusterPlatform }}-{{ $.Values.clusterGroup.name }}.yaml"
170+
- "$gitref{{ $refcount }}/values-{{ $.Values.global.clusterPlatform }}-{{ $.Values.clusterGroup.name }}.yaml"
167171
{{- end }}
168172
{{- if $.Values.global.clusterVersion }}
169-
- "$gitref/values-{{ $.Values.global.clusterVersion }}-{{ $.Values.clusterGroup.name }}.yaml"
173+
- "$gitref{{ $refcount }}/values-{{ $.Values.global.clusterVersion }}-{{ $.Values.clusterGroup.name }}.yaml"
170174
{{- end }}
171175
{{- range $valueFile := .extraValueFiles }}
172176
- {{ $valueFile | quote }}

0 commit comments

Comments
 (0)