@@ -141,32 +141,39 @@ spec:
141141 project : {{ .project }}
142142
143143 {{- if .sources }}
144+ {{- $refcount := 0 }}
145+ {{ $isChart := false }}
144146 sources :
145- {{- range .sources }}
147+ {{- range .sources }}
146148 - repoURL : {{ coalesce .repoURL $.Values.global.repoURL }}
147149 targetRevision : {{ coalesce .targetRevision $.Values.global.targetRevision }}
148150 {{- if .chart }}
149151 chart : {{ .chart }}
152+ {{ $isChart = true }}
150153 {{- else if .path }}
151154 path : {{ .path }}
155+ {{ $isChart = false }}
152156 {{- else }}
153- ref : gitref
157+ {{ $isChart = false }}
154158 {{- end }}
155- {{- if and (not .kustomize) (.chart) }}
159+ {{- if not (.chart) }}
160+ ref : gitref{{$refcount}}
161+ {{- end }}
162+ {{- if and (not .kustomize) }}
156163 helm :
157164 ignoreMissingValueFiles : true
158165 valueFiles :
159- - " $gitref/values-global.yaml"
160- - " $gitref/values-{{ $.Values.clusterGroup.name }}.yaml"
166+ - " $gitref{{ $refcount }} /values-global.yaml"
167+ - " $gitref{{ $refcount }} /values-{{ $.Values.clusterGroup.name }}.yaml"
161168 {{- if $.Values.global.clusterPlatform }}
162- - " $gitref/values-{{ $.Values.global.clusterPlatform }}.yaml"
169+ - " $gitref{{ $refcount }} /values-{{ $.Values.global.clusterPlatform }}.yaml"
163170 {{- if $.Values.global.clusterVersion }}
164- - " $gitref/values-{{ $.Values.global.clusterPlatform }}-{{ $.Values.global.clusterVersion }}.yaml"
171+ - " $gitref{{ $refcount }} /values-{{ $.Values.global.clusterPlatform }}-{{ $.Values.global.clusterVersion }}.yaml"
165172 {{- end }}
166- - " $gitref/values-{{ $.Values.global.clusterPlatform }}-{{ $.Values.clusterGroup.name }}.yaml"
173+ - " $gitref{{ $refcount }} /values-{{ $.Values.global.clusterPlatform }}-{{ $.Values.clusterGroup.name }}.yaml"
167174 {{- end }}
168175 {{- if $.Values.global.clusterVersion }}
169- - " $gitref/values-{{ $.Values.global.clusterVersion }}-{{ $.Values.clusterGroup.name }}.yaml"
176+ - " $gitref{{ $refcount }} /values-{{ $.Values.global.clusterVersion }}-{{ $.Values.clusterGroup.name }}.yaml"
170177 {{- end }}
171178 {{- range $valueFile := .extraValueFiles }}
172179 - {{ $valueFile | quote }}
@@ -234,13 +241,11 @@ spec:
234241 {{- end }}{{- /* END RANGE */}}
235242 {{- end }} {{- /* END FILEPARAMETERS */}}
236243 {{- end }} {{- /* IF NOT PLUGIN-ELSE */}}
237-
238-
239-
240-
244+ {{- if not ( $isChart ) }}
245+ {{ $refcount = add1 $refcount }}
246+ {{- end }}
241247 {{- end }}
242248 {{- else }}
243-
244249 source :
245250 repoURL : {{ coalesce .repoURL $.Values.global.repoURL }}
246251 targetRevision : {{ coalesce .targetRevision $.Values.global.targetRevision }}
0 commit comments