Skip to content

Commit

Permalink
add default image tag for code executor (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
avimoondra authored Feb 7, 2024
1 parent 1f2de75 commit 199f806
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/retool/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: retool
description: A Helm chart for Kubernetes
type: application
version: 6.0.14
version: 6.0.15
maintainers:
- name: Retool Engineering
email: [email protected]
Expand Down
27 changes: 25 additions & 2 deletions charts/retool/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,17 @@ Usage: (include "retool.codeExecutor.enabled" .)
{{- else -}}
{{- $output = "" -}}
{{- end -}}
{{- else if empty .Values.codeExecutor.image.tag -}}
{{- else if empty (include "retool.codeExecutor.image.tag" .) -}}
{{- $output = "" -}}
{{- else if semverCompare ">= 3.20.15" .Values.codeExecutor.image.tag -}}
{{- else if semverCompare ">= 3.20.15" (include "retool.codeExecutor.image.tag" .) -}}
{{- $output = "1" -}}
{{- else -}}
{{- $output = "" -}}
{{- end -}}
{{- $output -}}
{{- end -}}


{{/*
Set Temporal frontend host
*/}}
Expand Down Expand Up @@ -226,3 +227,25 @@ Set code executor service name
{{- define "retool.codeExecutor.name" -}}
{{ template "retool.fullname" . }}-code-executor
{{- end -}}

{{/*
Set code executor image tag
Usage: (template "retool.codeExecutor.image.tag" .)
*/}}
{{- define "retool.codeExecutor.image.tag" -}}
{{- if .Values.codeExecutor.image.tag -}}
{{- .Values.codeExecutor.image.tag -}}
{{- else if .Values.image.tag -}}
{{- if and (eq .Values.image.tag "latest") (eq (toString .Values.codeExecutor.enabled) "true") -}}
{{- fail "If using image.tag=latest (not recommended, select an explicit tag instead) and enabling codeExecutor, explicitly set codeExecutor.image.tag" }}
{{- else if (eq .Values.image.tag "latest") -}}
{{- "" -}}
{{- else if semverCompare ">= 3.20.15" .Values.image.tag -}}
{{- .Values.image.tag -}}
{{- else -}}
{{- "1.1.0" -}}
{{- end -}}
{{- else -}}
{{- fail "Please set a value for .Values.image.tag" }}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/retool/templates/deployment_code_executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.codeExecutor.image.repository }}:{{ required "Please set a value for .Values.codeExecutor.image.tag" .Values.codeExecutor.image.tag }}"
image: "{{ .Values.codeExecutor.image.repository }}:{{ include "retool.codeExecutor.image.tag" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
privileged: true
Expand Down
3 changes: 2 additions & 1 deletion charts/retool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ codeExecutor:

image:
repository: tryretool/code-executor-service
tag:
# defaults to image.tag if >= 3.20.15, otherwise defaults to 1.1.0; explicitly set to override.
# tag:
pullPolicy: IfNotPresent

retool-temporal-services-helm:
Expand Down
3 changes: 2 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ codeExecutor:

image:
repository: tryretool/code-executor-service
tag:
# defaults to image.tag if >= 3.20.15, otherwise defaults to 1.1.0; explicitly set to override.
# tag:
pullPolicy: IfNotPresent

retool-temporal-services-helm:
Expand Down

0 comments on commit 199f806

Please sign in to comment.