[vFW_CNF_CDS] Update of python-sdk for vFW_CNF use case
[demo.git] / tutorials / ApacheCNF / templates / cba / Templates / k8s-configs / deployment-config / charts / common / templates / _images.tpl
1 {{/* vim: set filetype=mustache: */}}
2 {{/*
3 Return the proper image name
4 {{ include "common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" $) }}
5 */}}
6 {{- define "common.images.image" -}}
7 {{- $registryName := .imageRoot.registry -}}
8 {{- $repositoryName := .imageRoot.repository -}}
9 {{- $tag := .imageRoot.tag | toString -}}
10 {{- if .global }}
11     {{- if .global.imageRegistry }}
12      {{- $registryName = .global.imageRegistry -}}
13     {{- end -}}
14 {{- end -}}
15 {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
16 {{- end -}}
17
18 {{/*
19 Return the proper Docker Image Registry Secret Names
20 {{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
21 */}}
22 {{- define "common.images.pullSecrets" -}}
23   {{- $pullSecrets := list }}
24
25   {{- if .global }}
26     {{- range .global.imagePullSecrets -}}
27       {{- $pullSecrets = append $pullSecrets . -}}
28     {{- end -}}
29   {{- end -}}
30
31   {{- range .images -}}
32     {{- range .pullSecrets -}}
33       {{- $pullSecrets = append $pullSecrets . -}}
34     {{- end -}}
35   {{- end -}}
36
37   {{- if (not (empty $pullSecrets)) }}
38 imagePullSecrets:
39     {{- range $pullSecrets }}
40   - name: {{ . }}
41     {{- end }}
42   {{- end }}
43 {{- end -}}