diff --git a/stable/elasticsearch-curator/Chart.yaml b/stable/elasticsearch-curator/Chart.yaml index 8e158b8190..7a8e0a7804 100644 --- a/stable/elasticsearch-curator/Chart.yaml +++ b/stable/elasticsearch-curator/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "5.5.4" description: A Helm chart for Elasticsearch Curator name: elasticsearch-curator -version: 2.0.1 +version: 2.0.2 home: https://github.com/elastic/curator keywords: - curator diff --git a/stable/elasticsearch-curator/templates/_helpers.tpl b/stable/elasticsearch-curator/templates/_helpers.tpl index 2ef3ceb99e..8018c5d9c5 100644 --- a/stable/elasticsearch-curator/templates/_helpers.tpl +++ b/stable/elasticsearch-curator/templates/_helpers.tpl @@ -11,6 +11,17 @@ Return the appropriate apiVersion for cronjob APIs. {{- end -}} {{- end -}} +{{/* +Return the appropriate apiVersion for podsecuritypolicy. +*/}} +{{- define "podsecuritypolicy.apiVersion" -}} +{{- if semverCompare "<1.10-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "extensions/v1beta1" -}} +{{- else -}} +{{- print "policy/v1beta1" -}} +{{- end -}} +{{- end -}} + {{/* Expand the name of the chart. */}} diff --git a/stable/elasticsearch-curator/templates/psp.yml b/stable/elasticsearch-curator/templates/psp.yml index a840091894..5f62985871 100644 --- a/stable/elasticsearch-curator/templates/psp.yml +++ b/stable/elasticsearch-curator/templates/psp.yml @@ -1,5 +1,5 @@ {{- if .Values.psp.create }} -apiVersion: extensions/v1beta1 +apiVersion: {{ template "podsecuritypolicy.apiVersion" . }} kind: PodSecurityPolicy metadata: labels: