Skip to content

Commit

Permalink
[stable/kured] Change psp apiVersion for K8s 1.16 (helm#18373)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kotzbauer <christian.kotzbauer@gmail.com>
  • Loading branch information
ckotzbauer authored and Jose Alban committed Nov 22, 2019
1 parent 113659a commit bcaaf02
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stable/kured/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions stable/kured/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
2 changes: 1 addition & 1 deletion stable/kured/templates/podsecuritypolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.podSecurityPolicy.create}}
apiVersion: extensions/v1beta1
apiVersion: {{ template "kured.psp.apiVersion" . }}
kind: PodSecurityPolicy
metadata:
name: {{ template "kured.fullname" . }}
Expand Down

0 comments on commit bcaaf02

Please sign in to comment.