diff --git a/stable/nfs-client-provisioner/Chart.yaml b/stable/nfs-client-provisioner/Chart.yaml index a0a312d0ef..ac5ccaea77 100644 --- a/stable/nfs-client-provisioner/Chart.yaml +++ b/stable/nfs-client-provisioner/Chart.yaml @@ -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: diff --git a/stable/nfs-client-provisioner/templates/_helpers.tpl b/stable/nfs-client-provisioner/templates/_helpers.tpl index 824e26c23f..d8d4e516ac 100644 --- a/stable/nfs-client-provisioner/templates/_helpers.tpl +++ b/stable/nfs-client-provisioner/templates/_helpers.tpl @@ -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 -}} \ No newline at end of file diff --git a/stable/nfs-client-provisioner/templates/podsecuritypolicy.yaml b/stable/nfs-client-provisioner/templates/podsecuritypolicy.yaml index 290fbcd72c..830fad6ec8 100644 --- a/stable/nfs-client-provisioner/templates/podsecuritypolicy.yaml +++ b/stable/nfs-client-provisioner/templates/podsecuritypolicy.yaml @@ -1,5 +1,5 @@ {{- if .Values.podSecurityPolicy.enabled }} -apiVersion: extensions/v1beta1 +apiVersion: {{ template "podSecurityPolicy.apiVersion" . }} kind: PodSecurityPolicy metadata: name: {{ template "nfs-client-provisioner.fullname" . }}