From 8d00832aa90b1f24cd03c8cdc3edff595672d494 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Thu, 17 May 2018 14:49:52 -0700 Subject: [PATCH] Fix for version comparison from strings to semver (#4608) * Fix for version comparison from strings to semver See #3002 for more detail * Include pre-releases in the semver ranges This is important when testing against alpha and beta builds of Kubernetes along with environments that use pre-releases to denote things other than pre-releases (e.g., gke denotes the environment with a pre-releases) --- stable/traefik/Chart.yaml | 2 +- stable/traefik/templates/deployment.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stable/traefik/Chart.yaml b/stable/traefik/Chart.yaml index 49411621c3..0fc132e457 100755 --- a/stable/traefik/Chart.yaml +++ b/stable/traefik/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: traefik -version: 1.29.2 +version: 1.29.3 appVersion: 1.5.4 description: A Traefik based Kubernetes ingress controller with Let's Encrypt support keywords: diff --git a/stable/traefik/templates/deployment.yaml b/stable/traefik/templates/deployment.yaml index a458187844..37be384c53 100644 --- a/stable/traefik/templates/deployment.yaml +++ b/stable/traefik/templates/deployment.yaml @@ -17,7 +17,7 @@ spec: metadata: annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} - {{- if and (.Values.tolerations) (le .Capabilities.KubeVersion.Minor "5") }} + {{- if and (.Values.tolerations) (semverCompare "<1.6-0" .Capabilities.KubeVersion.GitVersion) }} scheduler.alpha.kubernetes.io/tolerations: '{{ toJson .Values.tolerations }}' {{- end }} {{- range $key, $value := .Values.deployment.podAnnotations }} @@ -134,7 +134,7 @@ spec: emptyDir: {} {{- end }} {{- end }} - {{- if and (.Values.tolerations) (ge .Capabilities.KubeVersion.Minor "6") }} + {{- if and (.Values.tolerations) (semverCompare "^1.6-0" .Capabilities.KubeVersion.GitVersion) }} tolerations: {{ toYaml .Values.tolerations | indent 6 }} {{- end }}