From 297adabd1c763df4caacdb6bd761c99b9cacfa55 Mon Sep 17 00:00:00 2001 From: Igor Karpukhin Date: Fri, 4 Oct 2024 15:34:29 +0200 Subject: [PATCH] Fixed templates --- charts/atlas-advanced/templates/_helpers.tpl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/charts/atlas-advanced/templates/_helpers.tpl b/charts/atlas-advanced/templates/_helpers.tpl index 89aa2873..3487d765 100644 --- a/charts/atlas-advanced/templates/_helpers.tpl +++ b/charts/atlas-advanced/templates/_helpers.tpl @@ -70,9 +70,8 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- define "getInstanceSizeOrFail" -}} {{- $arg := . -}} {{ $instances := list "M10" "M20" "M30" "M40" "M50" "M60" "M80" "M100" "M140" "M200" "M300" "R40" "R50" "R60" "R80" "R200" "R300" "R400" "R700" "M40_NVME" "M50_NVME" "M60_NVME" "M80_NVME" "M200_NVME" "M400_NVME" }} -{{- if not (has $arg $instances)}} -{{ $str := join "," $instances }} -{{- fail "Instance size can only be one of " print $str }} +{{- if not (has (toString $arg) $instances)}} +{{- fail (printf "Instance size can only be one of: %s " (join "," $instances)) }} {{- end }} {{- $arg -}} {{- end }} @@ -80,9 +79,8 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- define "getProviderNameOrFail" -}} {{- $arg := . -}} {{ $providers := list "AWS" "GCP" "AZURE" }} -{{- if not (has $arg $providers) }} -{{ $str := join "," $providers }} -{{- fail "Provider name can only be one of " print $str }} +{{- if not (has (toString $arg) $providers) }} +{{- fail (printf "Provider name can only be one of: %s. Got %s" (join "," $providers) $arg) }} {{- end }} {{- $arg -}} {{- end }} \ No newline at end of file