Skip to content

Commit

Permalink
chart(fix): ensure images are pre-pulled and started together in Node (
Browse files Browse the repository at this point in the history
…#2387)

Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 authored Sep 9, 2024
1 parent 5f42b30 commit 44d9224
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
24 changes: 16 additions & 8 deletions charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ Component update strategy template
Common pod template
*/}}
{{- define "seleniumGrid.podTemplate" -}}
{{- $nodeImageRegistry := default $.Values.global.seleniumGrid.imageRegistry .node.imageRegistry -}}
{{- $nodeImageTag := default $.Values.global.seleniumGrid.nodesImageTag .node.imageTag -}}
{{- $videoImageRegistry := default $.Values.global.seleniumGrid.imageRegistry $.Values.videoRecorder.imageRegistry -}}
{{- $videoImageTag := default $.Values.global.seleniumGrid.videoImageTag $.Values.videoRecorder.imageTag -}}
template:
metadata:
labels:
Expand Down Expand Up @@ -298,15 +302,21 @@ template:
{{- with .node.hostAliases }}
hostAliases: {{ toYaml . | nindent 6 }}
{{- end }}
{{- with .node.initContainers }}
initContainers:
- name: "pre-puller-{{ .name }}"
image: {{ printf "%s/%s:%s" $nodeImageRegistry .node.imageName $nodeImageTag }}
command: ["bash", "-c", "'true'"]
{{- if $.Values.videoRecorder.enabled }}
- name: "pre-puller-{{ $.Values.videoRecorder.name }}"
image: {{ printf "%s/%s:%s" $videoImageRegistry $.Values.videoRecorder.imageName $videoImageTag }}
command: ["bash", "-c", "'true'"]
{{- end }}
{{- with .node.initContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
containers:
- name: {{ .name }}
{{- $imageTag := default $.Values.global.seleniumGrid.nodesImageTag .node.imageTag }}
{{- $imageRegistry := default $.Values.global.seleniumGrid.imageRegistry .node.imageRegistry }}
image: {{ printf "%s/%s:%s" $imageRegistry .node.imageName $imageTag }}
image: {{ printf "%s/%s:%s" $nodeImageRegistry .node.imageName $nodeImageTag }}
imagePullPolicy: {{ .node.imagePullPolicy }}
env:
- name: SE_NODE_CONTAINER_NAME
Expand Down Expand Up @@ -444,9 +454,7 @@ template:
{{- end }}
{{- if $.Values.videoRecorder.enabled }}
- name: {{ $.Values.videoRecorder.name }}
{{- $imageTag := default $.Values.global.seleniumGrid.videoImageTag $.Values.videoRecorder.imageTag }}
{{- $imageRegistry := default $.Values.global.seleniumGrid.imageRegistry $.Values.videoRecorder.imageRegistry }}
image: {{ printf "%s/%s:%s" $imageRegistry $.Values.videoRecorder.imageName $imageTag }}
image: {{ printf "%s/%s:%s" $videoImageRegistry $.Values.videoRecorder.imageName $videoImageTag }}
imagePullPolicy: {{ $.Values.videoRecorder.imagePullPolicy }}
env:
- name: SE_NODE_PORT
Expand Down
1 change: 1 addition & 0 deletions tests/charts/templates/render/dummy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ autoscaling:
scalingType: deployment

basicAuth:
enabled: true
username: sysadmin
password: strongPassword

Expand Down
1 change: 1 addition & 0 deletions tests/charts/templates/render/dummy_solution.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ selenium-grid:
scalingType: deployment

basicAuth:
enabled: true
username: sysadmin
password: strongPassword

Expand Down

0 comments on commit 44d9224

Please sign in to comment.