diff --git a/stable/kured/Chart.yaml b/stable/kured/Chart.yaml index 21a87667d273..76c9005b361b 100644 --- a/stable/kured/Chart.yaml +++ b/stable/kured/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.2.0" description: A Helm chart for kured name: kured -version: 1.4.0 +version: 1.4.1 home: https://github.com/weaveworks/kured maintainers: - name: plumdog diff --git a/stable/kured/templates/_helpers.tpl b/stable/kured/templates/_helpers.tpl index eedec519d66f..38c3a4389684 100644 --- a/stable/kured/templates/_helpers.tpl +++ b/stable/kured/templates/_helpers.tpl @@ -41,3 +41,14 @@ Create the name of the service account to use {{ default "default" .Values.serviceAccount.name }} {{- end -}} {{- end -}} + +{{/* +Return the appropriate apiVersion for podsecuritypolicy. +*/}} +{{- define "kured.psp.apiVersion" -}} +{{- if semverCompare "<1.10-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "extensions/v1beta1" -}} +{{- else -}} +{{- print "policy/v1beta1" -}} +{{- end -}} +{{- end -}} diff --git a/stable/kured/templates/podsecuritypolicy.yaml b/stable/kured/templates/podsecuritypolicy.yaml index da0a38ea862c..d4e2f18a891a 100644 --- a/stable/kured/templates/podsecuritypolicy.yaml +++ b/stable/kured/templates/podsecuritypolicy.yaml @@ -1,5 +1,5 @@ {{- if .Values.podSecurityPolicy.create}} -apiVersion: extensions/v1beta1 +apiVersion: {{ template "kured.psp.apiVersion" . }} kind: PodSecurityPolicy metadata: name: {{ template "kured.fullname" . }}