[stable/nfs-client-provisioner] Fix compatibility issue with 1.16 (#18132)

* Fix psp for 1.16

Signed-off-by: Markus Schlotbohm <markus_schlotbohm@as-gmbh.de>

* Bump Char version of nfs-client-provisioner

Signed-off-by: Markus Schlotbohm <markus_schlotbohm@as-gmbh.de>

* Add semverCompare for apiVersion compatibility

Signed-off-by: Markus Schlotbohm <markus_schlotbohm@as-gmbh.de>
This commit is contained in:
Markus Schlotbohm
2019-10-21 00:43:37 -07:00
committed by Kubernetes Prow Robot
parent 6046ed0cfb
commit adaed47c91
3 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ appVersion: 3.1.0
description: nfs-client is an automatic provisioner that used your *already configured* NFS server, automatically creating Persistent Volumes.
name: nfs-client-provisioner
home: https://github.com/kubernetes-incubator/external-storage/tree/master/nfs-client
version: 1.2.6
version: 1.2.7
sources:
- https://github.com/kubernetes-incubator/external-storage/tree/master/nfs-client
maintainers:
@@ -49,3 +49,14 @@ Create the name of the service account to use
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for podSecurityPolicy.
*/}}
{{- define "podSecurityPolicy.apiVersion" -}}
{{- if semverCompare ">=1.10-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "policy/v1beta1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
@@ -1,5 +1,5 @@
{{- if .Values.podSecurityPolicy.enabled }}
apiVersion: extensions/v1beta1
apiVersion: {{ template "podSecurityPolicy.apiVersion" . }}
kind: PodSecurityPolicy
metadata:
name: {{ template "nfs-client-provisioner.fullname" . }}