From a330ab60c18259a70deb482bad7bccda5af70fee Mon Sep 17 00:00:00 2001 From: Avi Moondra Date: Tue, 6 Feb 2024 15:44:22 -0500 Subject: [PATCH] update logic --- charts/retool/templates/_helpers.tpl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/charts/retool/templates/_helpers.tpl b/charts/retool/templates/_helpers.tpl index 34242ad..41aa6c7 100644 --- a/charts/retool/templates/_helpers.tpl +++ b/charts/retool/templates/_helpers.tpl @@ -177,6 +177,8 @@ Usage: (include "retool.codeExecutor.enabled" .) {{- else -}} {{- $output = "" -}} {{- end -}} +{{- else if empty (include "retool.codeExecutor.image.tag" .) -}} + {{- $output = "" -}} {{- else if semverCompare ">= 3.20.15" (include "retool.codeExecutor.image.tag" .) -}} {{- $output = "1" -}} {{- else -}} @@ -234,8 +236,10 @@ Usage: (template "retool.codeExecutor.image.tag" .) {{- if .Values.codeExecutor.image.tag -}} {{- .Values.codeExecutor.image.tag -}} {{- else if .Values.image.tag -}} - {{- if eq .Values.image.tag "latest" -}} - {{- fail "If using image.tag=latest (not recommended), explicitly set codeExecutor.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 -}} @@ -244,4 +248,4 @@ Usage: (template "retool.codeExecutor.image.tag" .) {{- else -}} {{- fail "Please set a value for .Values.image.tag" }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}}