my-apps/charts/common/templates/lib/chart/_check_capabitilies.tpl
2025-08-24 00:09:37 +03:00

17 lines
616 B
Smarty

{{- define "tc.v1.common.check.capabilities" -}}
{{- $helmVersion := semver .Capabilities.HelmVersion.Version -}}
{{- $helmMinVer := semver "3.14.0" -}}
{{- if .Chart.Annotations -}}
{{- $min := index .Chart.Annotations "truecharts.org/min_helm_version" -}}
{{- if $min -}}
{{/* Apply a relaxed version check */}}
{{- $helmMinVer = semver $min -}}
{{- end -}}
{{- end -}}
{{- if eq -1 ($helmMinVer | $helmVersion.Compare) -}}
{{- fail (printf "Expected minimum helm version [%s], but found [%s]. Upgrade helm cli tool." $helmMinVer $helmVersion) -}}
{{- end -}}
{{- end -}}