168168{{- $iconFile := (index . " ICON_FILE" ) -}}
169169Icon: | -
170170{{ $parent .Files.Get (printf " %s " $iconFile ) | indent 2}}
171+ {{- end -}}
172+
173+
174+
175+ {{ define " hull.vidispine.addon.sources.folder.volumes" }}
176+ {{ $parent := (index . " PARENT_CONTEXT" ) }}
177+ {
178+ " installation" :
179+ {
180+ " secret" :{ " secretName" : " hull-install" }
181+ },
182+ " custom-installation-files" :
183+ {
184+ " secret" : { " secretName" : " custom-installation-files" }
185+ },
186+ " etcssl" :
187+ {
188+ " enabled" : {{ if $parent .Values.hull.config.general.data.installation.config.customCaCertificates }}true{{ else }}false{{ end }},
189+ " emptyDir" : { }
190+ },
191+ " certs" :
192+ { " enabled" : {{ if $parent .Values.hull.config.general.data.installation.config.customCaCertificates }}true{{ else }}false{{ end }},
193+ " secret" : { " secretName" : " custom-ca-certificates" }
194+ },
195+ {{ $processedDict := dict }}
196+ {{ $folderCount := 0 }}
197+ {{ range $file , $_ := $parent .Files.Glob " files/hull-vidispine-addon/installation/sources/**/*" }}
198+ {{- $folder := base (dir $file ) }}
199+ {{- if not (hasKey $processedDict $folder ) -}}
200+ {{ $folderCount = add $folderCount 1 }}
201+ {{ $_ := set $processedDict $folder " true" }}
202+ " custom-installation-files-{{ $folder }}" :
203+ {
204+ secret:
205+ {
206+ secretName: " custom-installation-files-{{ $folderCount }}"
207+ }
208+ },
209+ {{ end }}
210+ {{ end }}
211+ }
212+ {{ end }}
213+
214+
215+
216+ {{ define " hull.vidispine.addon.sources.folder.volumemounts" }}
217+ {{ $parent := (index . " PARENT_CONTEXT" ) }}
218+ {
219+ " installation" :
220+ {
221+ " name" : " installation" ,
222+ " mountPath" : " /script"
223+ },
224+ " custom-installation-files" :
225+ {
226+ " name" : " custom-installation-files" ,
227+ " mountPath" : " /custom-installation-files"
228+ },
229+ " etcssl" :
230+ {
231+ " enabled" : {{ if $parent .Values.hull.config.general.data.installation.config.customCaCertificates }}true{{ else }}false{{ end }},
232+ " name" : " etcssl" ,
233+ " mountPath" : " /etc/ssl/certs"
234+ },
235+ {{ range $certkey , $certvalue := $parent .Values.hull.config.general.data.installation.config.customCaCertificates }}
236+ " custom-ca-certificates-{{ $certkey }}" :
237+ {
238+ " enabled" : true,
239+ " name" : " certs" ,
240+ " mountPath" : " /usr/local/share/ca-certificates/custom-ca-certificates-{{ $certkey }}" ,
241+ " subPath" : " {{ $certkey }}"
242+ },
243+ {{ end }}
244+ {{ $processedDict := dict }}
245+ {{ range $file , $_ := $parent .Files.Glob " files/hull-vidispine-addon/installation/sources/**/*" }}
246+ {{- $folder := base (dir $file ) }}
247+ {{- if not (hasKey $processedDict $folder ) -}}
248+ {{ $_ := set $processedDict $folder " true" }}
249+ " custom-installation-files-{{ $folder }}" :
250+ {
251+ " enabled" : true,
252+ " name" : " custom-installation-files-{{ $folder }}" ,
253+ " mountPath" : " /custom-installation-files-{{ $folder }}"
254+ },
255+ {{ end }}
256+ {{ end }}
257+ }
258+ {{ end }}
259+
260+
261+
262+ {{ define " hull.vidispine.addon.sources.folder.secret" }}
263+ {{ $parent := (index . " PARENT_CONTEXT" ) }}
264+ {{ $folderIndex := (index . " FOLDER_INDEX" ) }}
265+ {
266+ {{ $processedDict := dict }}
267+ {{ $folderCount := 0 }}
268+ {{ range $file , $_ := $parent .Files.Glob " files/hull-vidispine-addon/installation/sources/**/*" }}
269+ {{- $folder := base (dir $file ) }}
270+ {{- $fileName := base $file }}
271+ {{- if not (hasKey $processedDict $folder ) -}}
272+ {{- $folderCount = add $folderCount 1 }}
273+ {{ $_ := set $processedDict $folder $folderCount }}
274+ {{- end -}}
275+ {{ if (eq (index $processedDict $folder ) $folderIndex ) }}
276+ {{ $fileName | base | quote }}: { path: {{ $file | quote }} },
277+ {{ end }}
278+ {{ end }}
279+ }
280+ {{ end }}
281+
282+
283+
284+ {{- define " hull.vidispine.addon.sources.folder.secret.count" -}}
285+ {{- $parent := (index . " PARENT_CONTEXT" ) -}}
286+ {{- $folderIndex := (index . " FOLDER_INDEX" ) -}}
287+ {{- $processedDict := dict -}}
288+ {{- $folderCount := 0 -}}
289+ {{- $folderExists := false -}}
290+ {{- range $file , $_ := $parent .Files.Glob " files/hull-vidispine-addon/installation/sources/**/*" -}}
291+ {{- $folder := base (dir $file ) -}}
292+ {{- if not (hasKey $processedDict $folder ) -}}
293+ {{- $folderCount = add $folderCount 1 -}}
294+ {{- $_ := set $processedDict $folder $folderCount -}}
295+ {{- end -}}
296+ {{- end -}}
297+ {{- $folderCount -}}
171298{{- end -}}
0 commit comments