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)
This commit is contained in:
Matt Farina
2018-04-03 10:03:06 -07:00
committed by k8s-ci-robot
parent f0bdfde774
commit 3e85eaff1c
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -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
+2 -2
View File
@@ -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 -}}