Skip to content

Commit

Permalink
Bump launcher templates for Workbench chart to 2.5.0
Browse files Browse the repository at this point in the history
Adds init containers support from the Job spec.
  • Loading branch information
zachhannum authored and melissa-barca committed Dec 17, 2024
1 parent 2cdb401 commit cb31e50
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
44 changes: 43 additions & 1 deletion charts/rstudio-workbench/files/job.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Version: 2.4.0
# Version: 2.5.0
# DO NOT MODIFY the "Version: " key
# Helm Version: v1
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
Expand Down Expand Up @@ -144,6 +144,48 @@ spec:
imagePullSecrets: {{ toYaml . | nindent 12 }}
{{- end }}
initContainers:
{{- with .Job.initContainers }}
{{- range . }}
- name: {{ toYaml .name }}
image: {{ toYaml .image }}
{{- $isShell := false }}
{{- if .command }}
command: ['/bin/sh']
{{- $isShell = true }}
{{- else if .exe }}
command: [{{ toYaml .exe }}]
{{- $isShell = false }}
{{- end }}
{{- if or .args $isShell }}
args:
{{- if $isShell }}
- '-c'
{{- if .args }}
- {{ .args | join " " | cat .command | toYaml | indent 12 | trimPrefix (repeat 12 " ") }}
{{- else }}
- {{ .command | toYaml | indent 12 | trimPrefix (repeat 12 " ") }}
{{- end }}
{{- else }}
{{- range .args }}
- {{ toYaml . | indent 12 | trimPrefix (repeat 12 " ") }}
{{- end }}
{{- end }}
{{- end }}
{{- if .environment }}
env:
{{- range .environment }}
- name: {{ toYaml .name | indent 14 | trimPrefix (repeat 14 " ") }}
value: {{ toYaml .value | indent 14 | trimPrefix (repeat 14 " ") }}
{{- end }}
{{- end }}
{{- if .mounts }}
volumeMounts:
{{- range .mounts }}
- {{ nindent 14 (toYaml .) | trim -}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Job.metadata.pod.initContainers }}
{{- range . }}
- {{ toYaml . | indent 10 | trimPrefix (repeat 10 " ") }}
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-workbench/files/service.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Version: 2.4.0
# Version: 2.5.0
# DO NOT MODIFY the "Version: " key
# Helm Version: v1
{{- $templateData := include "rstudio-library.templates.data" nil | mustFromJson }}
Expand Down

0 comments on commit cb31e50

Please sign in to comment.