1 {{/* vim: set filetype=mustache: */}}
3 Return the proper image name
4 {{ include "common.images.image" ( dict "imageRoot" .Values.path.to.the.image "global" $) }}
6 {{- define "common.images.image" -}}
7 {{- $registryName := .imageRoot.registry -}}
8 {{- $repositoryName := .imageRoot.repository -}}
9 {{- $separator := ":" -}}
10 {{- $termination := .imageRoot.tag | toString -}}
12 {{- if .global.imageRegistry }}
13 {{- $registryName = .global.imageRegistry -}}
16 {{- if .imageRoot.digest }}
17 {{- $separator = "@" -}}
18 {{- $termination = .imageRoot.digest | toString -}}
20 {{- printf "%s/%s%s%s" $registryName $repositoryName $separator $termination -}}
24 Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead)
25 {{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }}
27 {{- define "common.images.pullSecrets" -}}
28 {{- $pullSecrets := list }}
31 {{- range .global.imagePullSecrets -}}
32 {{- $pullSecrets = append $pullSecrets . -}}
37 {{- range .pullSecrets -}}
38 {{- $pullSecrets = append $pullSecrets . -}}
42 {{- if (not (empty $pullSecrets)) }}
44 {{- range $pullSecrets }}
51 Return the proper Docker Image Registry Secret Names evaluating values as templates
52 {{ include "common.images.renderPullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $) }}
54 {{- define "common.images.renderPullSecrets" -}}
55 {{- $pullSecrets := list }}
56 {{- $context := .context }}
58 {{- if $context.Values.global }}
59 {{- range $context.Values.global.imagePullSecrets -}}
60 {{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}}
65 {{- range .pullSecrets -}}
66 {{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" $context)) -}}
70 {{- if (not (empty $pullSecrets)) }}
72 {{- range $pullSecrets }}