File tree Expand file tree Collapse file tree 5 files changed +28
-7
lines changed
Expand file tree Collapse file tree 5 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 11{ {/* vim: set filetype= mustache: */} }
22{ {/*
33Return the proper image name
4- {{ include " hf.common.images.image" ( dict " imageRoot" .Values.path.to.the.image " global" .Values.global ) } }
4+ {{ include " hf.common.images.image" ( dict " imageRoot" .Values.path.to.the.image " global" .Values.global " tag " .Chart.AppVersion ) } }
55*/}}
66{ {- define " hf.common.images.image" -} }
77{ {- $useGlobalRegistry := or (not (hasKey .imageRoot " useGlobalRegistry" )) .imageRoot.useGlobalRegistry -} }
88{ {- $registryName := .imageRoot.registry -} }
99{ {- $repositoryName := .imageRoot.repository -} }
1010{ {- $separator := " :" -} }
11- { {- $termination := .imageRoot.tag | toString -} }
11+ { {- $termination := .imageRoot.tag | default .tag | toString -} }
1212{ {- if .global } }
1313 { {- if and .global.imageRegistry $useGlobalRegistry } }
1414 { {- $registryName = .global.imageRegistry -} }
@@ -33,7 +33,7 @@ Return the proper Docker Image Registry Secret Names evaluating values as templa
3333 { {- $pullSecrets := list } }
3434 { {- $context := .context } }
3535
36- { {- if $context .Values. global. huggingface } }
36+ { {- if and $context $ context .Values $ context .Values. global $ context .Values.global. huggingface $ context .Values.global.huggingface.imagePullSecrets } }
3737 { {- range $context .Values.global.huggingface.imagePullSecrets -} }
3838 { {- $pullSecrets = append $pullSecrets (include " hf.common.tplvalues.render" (dict " value" . " context" $context )) -} }
3939 { {- end -} }
@@ -51,4 +51,4 @@ imagePullSecrets:
5151 - name: { { . } }
5252 { {- end } }
5353 { {- end } }
54- { {- end -} }
54+ { {- end -} }
Original file line number Diff line number Diff line change 77{{- end -}}
88
99{{- define "appManager.image" -}}
10- {{ include "hf.common.images.image" (dict "imageRoot" .Values.images.appManager "global" .Values.global.huggingface) | quote }}
10+ {{ include "hf.common.images.image" (dict "imageRoot" .Values.images.appManager "global" .Values.global.huggingface "tag" .Chart.AppVersion) | quote }}
11+ {{- end -}}
12+
13+ {{- define "someApp.image" -}}
14+ {{ include "hf.common.images.image" (dict "imageRoot" .Values.images.someApp "global" .Values.global.huggingface "tag" .Chart.AppVersion) | quote }}
1115{{- end -}}
1216
1317{{- define "test.imagePullSecrets" -}}
1418{{ include "hf.common.images.renderPullSecrets" (dict "images" (list .Values.images) "context" $) }}
15- {{- end -}}
19+ {{- end -}}
Original file line number Diff line number Diff line change 2121 imagePullPolicy : {{ .Values.images.pullPolicy }}
2222 - name : test-global-registry
2323 image : {{ include "appManager.image" . }}
24- imagePullPolicy : {{ .Values.images.pullPolicy }}
24+ imagePullPolicy : {{ .Values.images.pullPolicy }}
25+ - name : hello-world
26+ image : {{ include "someApp.image" . }}
27+ imagePullPolicy : {{ .Values.images.pullPolicy }}
Original file line number Diff line number Diff line change @@ -65,6 +65,18 @@ tests:
6565 path : spec.template.spec.containers[2].image
6666 value : spaces/app-manager:latest
6767
68+ - it : deployment should have the correct image tag reflecting chart appVersion
69+ values :
70+ - test-values.yaml
71+ template : deployment.yaml
72+ asserts :
73+ - equal :
74+ path : spec.template.spec.containers[3].name
75+ value : hello-world
76+ - equal :
77+ path : spec.template.spec.containers[3].image
78+ value : hello/world:1.0.0
79+
6880 - it : deployment shouldn't have imagePullSecret
6981 values :
7082 - test-values.yaml
Original file line number Diff line number Diff line change @@ -21,3 +21,5 @@ images:
2121 appManager :
2222 repository : spaces/app-manager
2323 tag : latest
24+ someApp :
25+ repository : hello/world
You can’t perform that action at this time.
0 commit comments