diff --git a/traefik/templates/_helpers.tpl b/traefik/templates/_helpers.tpl index 2e06dc0c0..7ab9ee594 100644 --- a/traefik/templates/_helpers.tpl +++ b/traefik/templates/_helpers.tpl @@ -138,7 +138,7 @@ based on semverCompare {{- if regexMatch "v[0-9]+.[0-9]+.[0-9]+" (default "" $.Values.image.tag) -}} {{- if semverCompare "<v3.3.2-0" $.Values.image.tag -}} {{ $hubVersion = "v3.0" }} - {{- else if semverCompare "<3.7.0-0" $.Values.image.tag -}} + {{- else if semverCompare "<v3.7.0-0" $.Values.image.tag -}} {{ $hubVersion = "v3.1" }} {{- end -}} {{- end -}} diff --git a/traefik/templates/_podtemplate.tpl b/traefik/templates/_podtemplate.tpl index 4325ecfc8..f83bb62e2 100644 --- a/traefik/templates/_podtemplate.tpl +++ b/traefik/templates/_podtemplate.tpl @@ -448,7 +448,7 @@ - "--experimental.plugins.{{ $pluginName }}.moduleName={{ $plugin.moduleName }}" - "--experimental.plugins.{{ $pluginName }}.version={{ $plugin.version }}" {{- end }} - {{- if and (semverCompare ">=3.3.0-0" $version) (.Values.experimental.abortOnPluginFailure)}} + {{- if and (semverCompare ">=v3.3.0-0" $version) (.Values.experimental.abortOnPluginFailure)}} - "--experimental.abortonpluginfailure={{ .Values.experimental.abortOnPluginFailure }}" {{- end }} {{- if .Values.providers.kubernetesCRD.enabled }} @@ -470,7 +470,7 @@ - "--providers.kubernetescrd.allowEmptyServices={{ . }}" {{- end }} {{- end }} - {{- if and .Values.rbac.namespaced (semverCompare ">=3.1.2-0" $version) }} + {{- if and .Values.rbac.namespaced (semverCompare ">=v3.1.2-0" $version) }} - "--providers.kubernetescrd.disableClusterScopeResources=true" {{- end }} {{- if .Values.providers.kubernetesCRD.nativeLBByDefault }} @@ -497,9 +497,9 @@ - "--providers.kubernetesingress.ingressClass={{ .Values.providers.kubernetesIngress.ingressClass }}" {{- end }} {{- if .Values.rbac.namespaced }} - {{- if semverCompare "<3.1.5-0" $version }} + {{- if semverCompare "<v3.1.5-0" $version }} - "--providers.kubernetesingress.disableIngressClassLookup=true" - {{- if semverCompare ">=3.1.2-0" $version }} + {{- if semverCompare ">=v3.1.2-0" $version }} - "--providers.kubernetesingress.disableClusterScopeResources=true" {{- end }} {{- else }} @@ -603,7 +603,7 @@ {{- end }} {{- end }} {{- if $config.allowACMEByPass }} - {{- if (semverCompare "<3.1.3-0" $version) }} + {{- if (semverCompare "<v3.1.3-0" $version) }} {{- fail "ERROR: allowACMEByPass has been introduced with Traefik v3.1.3+" -}} {{- end }} - "--entryPoints.{{ $entrypoint }}.allowACMEByPass=true" @@ -848,7 +848,7 @@ {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.topologySpreadConstraints }} - {{- if (semverCompare "<1.19.0-0" .Capabilities.KubeVersion.Version) }} + {{- if (semverCompare "<v1.19.0-0" .Capabilities.KubeVersion.Version) }} {{- fail "ERROR: topologySpreadConstraints are supported only on kubernetes >= v1.19" -}} {{- end }} topologySpreadConstraints: diff --git a/traefik/templates/hpa.yaml b/traefik/templates/hpa.yaml index cfa1e5a49..0e462099c 100644 --- a/traefik/templates/hpa.yaml +++ b/traefik/templates/hpa.yaml @@ -4,7 +4,7 @@ {{- fail "ERROR: maxReplicas is required on HPA" }} {{- end }} -{{- if semverCompare ">=1.23.0-0" .Capabilities.KubeVersion.Version }} +{{- if semverCompare ">=v1.23.0-0" .Capabilities.KubeVersion.Version }} apiVersion: autoscaling/v2 {{- else }} apiVersion: autoscaling/v2beta2 diff --git a/traefik/templates/rbac/podsecuritypolicy.yaml b/traefik/templates/rbac/podsecuritypolicy.yaml index bc0a3bdc7..dfdf59315 100644 --- a/traefik/templates/rbac/podsecuritypolicy.yaml +++ b/traefik/templates/rbac/podsecuritypolicy.yaml @@ -1,5 +1,5 @@ {{- if .Values.podSecurityPolicy.enabled }} -{{- if semverCompare ">=1.25.0-0" .Capabilities.KubeVersion.Version }} +{{- if semverCompare ">=v1.25.0-0" .Capabilities.KubeVersion.Version }} {{- fail "ERROR: PodSecurityPolicy has been removed in Kubernetes v1.25+" }} {{- end }} --- diff --git a/traefik/templates/requirements.yaml b/traefik/templates/requirements.yaml index 20d8b28ea..bab84c34b 100644 --- a/traefik/templates/requirements.yaml +++ b/traefik/templates/requirements.yaml @@ -1,6 +1,6 @@ {{- $version := include "imageVersion" $ }} {{- if (ne $version "experimental-v3.0") }} - {{- if (semverCompare "<3.0.0-0" $version) }} + {{- if (semverCompare "<v3.0.0-0" $version) }} {{- fail "ERROR: This version of the Chart only supports Traefik Proxy v3" -}} {{- end }} {{- end }} @@ -13,7 +13,7 @@ {{- fail "ERROR: traefik-hub image is required when enabling Traefik Hub" -}} {{- end }} -{{- if and (.Values.providers.kubernetesGateway).enabled (and (semverCompare "<3.1.0-rc3" $version) (not .Values.experimental.kubernetesGateway.enabled)) }} +{{- if and (.Values.providers.kubernetesGateway).enabled (and (semverCompare "<v3.1.0-rc3" $version) (not .Values.experimental.kubernetesGateway.enabled)) }} {{- fail "ERROR: Before traefik v3.1.0-rc3, kubernetesGateway is experimental. Enable it by setting experimental.kubernetesGateway.enabled to true" -}} {{- end }} @@ -32,6 +32,6 @@ {{- end }} {{- end }} -{{- if and (semverCompare "<3.3.0-0" $version) (.Values.experimental.abortOnPluginFailure)}} +{{- if and (semverCompare "<v3.3.0-0" $version) (.Values.experimental.abortOnPluginFailure)}} {{- fail "ERROR: abortOnPluginFailure is an experimental feature only available for traefik >= v3.3.0." }} {{- end }}