From 3e85eaff1c1f5b02c8a123b607bb6b85c0a55854 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Tue, 3 Apr 2018 13:03:06 -0400 Subject: [PATCH] Fix for version comparison from strings to semver (#4602) * Fix for version comparison from strings to semver See #3002 for more detail * Adding minio version for validation * 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/minio/Chart.yaml | 3 ++- stable/minio/templates/_helpers.tpl | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/stable/minio/Chart.yaml b/stable/minio/Chart.yaml index b54e9c878d..0b3f835649 100755 --- a/stable/minio/Chart.yaml +++ b/stable/minio/Chart.yaml @@ -1,7 +1,8 @@ apiVersion: v1 description: Distributed object storage server built for cloud applications and devops. name: minio -version: 1.0.0 +version: 1.0.1 +appVersion: RELEASE.2018-03-16T22-52-12Z keywords: - storage - object-storage diff --git a/stable/minio/templates/_helpers.tpl b/stable/minio/templates/_helpers.tpl index a5b0e6ed1b..c8fe9ba7aa 100644 --- a/stable/minio/templates/_helpers.tpl +++ b/stable/minio/templates/_helpers.tpl @@ -35,9 +35,9 @@ Create chart name and version as used by the chart label. Return the appropriate apiVersion for networkpolicy. */}} {{- define "minio.networkPolicy.apiVersion" -}} -{{- if and (ge .Capabilities.KubeVersion.Minor "4") (le .Capabilities.KubeVersion.Minor "6") -}} +{{- if semverCompare ">=1.4-0, <1.7-0" .Capabilities.KubeVersion.GitVersion -}} {{- print "extensions/v1beta1" -}} -{{- else if ge .Capabilities.KubeVersion.Minor "7" -}} +{{- else if semverCompare "^1.7-0" .Capabilities.KubeVersion.GitVersion -}} {{- print "networking.k8s.io/v1" -}} {{- end -}} {{- end -}}