diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index 8230b9c9..5b9a5d69 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -15,7 +15,7 @@ maintainers: name: common sources: null type: library -version: 24.0.2 +version: 24.0.3 annotations: artifacthub.io/category: "integration-delivery" artifacthub.io/license: "BUSL-1.1" diff --git a/library/common/templates/lib/chart/_check_capabitilies.tpl b/library/common/templates/lib/chart/_check_capabitilies.tpl index 6a1e27d7..fb395b07 100644 --- a/library/common/templates/lib/chart/_check_capabitilies.tpl +++ b/library/common/templates/lib/chart/_check_capabitilies.tpl @@ -1,16 +1,16 @@ {{- define "tc.v1.common.check.capabilities" -}} - {{- $helmVersion := .Capabilities.HelmVersion.Version -}} - {{- $helmVerCond := ">3.9.4" -}} + {{- $helmVersion := semver .Capabilities.HelmVersion.Version -}} + {{- $helmMinVer := semver "3.9.4" -}} {{- if .Chart.Annotations -}} {{- $min := index .Chart.Annotations "truecharts.org/min_helm_version" -}} {{- if $min -}} {{/* Apply a relaxed version check */}} - {{- $helmVerCond = printf ">=%s" $min -}} + {{- $helmMinVer = semver $min -}} {{- end -}} {{- end -}} - {{- if not (semverCompare $helmVerCond $helmVersion) -}} - {{- fail (printf "Expected helm version [%s], but found [%s]. Upgrade helm cli tool." $helmVerCond $helmVersion) -}} + {{- if eq -1 ($helmMinVer | $helmVersion.Compare) -}} + {{- fail (printf "Expected minimum helm version [%s], but found [%s]. Upgrade helm cli tool." $helmMinVer $helmVersion) -}} {{- end -}} {{- end -}}