From 2eb851720323a65826abdd787cc022b07cf38fe0 Mon Sep 17 00:00:00 2001 From: ustuzhanin <55892859+ustuzhanin@users.noreply.github.com> Date: Sat, 6 Jun 2020 00:39:46 +0500 Subject: [PATCH] [stable/percona-xtradb-cluster] fix StatefulSet apiVersion for Kubernetes 1.16+ (#22236) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix StatefulSet apiVersion for Kubernetes 1.16+ Signed-off-by: Устюжанин Антон Александрович * fix StatefulSet apiVersion for Kubernetes 1.16+ Signed-off-by: Устюжанин Антон Александрович Co-authored-by: Устюжанин Антон Александрович --- stable/percona-xtradb-cluster/Chart.yaml | 2 +- stable/percona-xtradb-cluster/templates/_helpers.tpl | 8 ++++++++ stable/percona-xtradb-cluster/templates/statefulset.yaml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/stable/percona-xtradb-cluster/Chart.yaml b/stable/percona-xtradb-cluster/Chart.yaml index e02540d3b3..fdc6b27159 100644 --- a/stable/percona-xtradb-cluster/Chart.yaml +++ b/stable/percona-xtradb-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: percona-xtradb-cluster -version: 1.0.3 +version: 1.0.4 appVersion: 5.7.19 description: free, fully compatible, enhanced, open source drop-in replacement for MySQL with Galera Replication (xtradb) diff --git a/stable/percona-xtradb-cluster/templates/_helpers.tpl b/stable/percona-xtradb-cluster/templates/_helpers.tpl index ac63390860..4a91f86138 100644 --- a/stable/percona-xtradb-cluster/templates/_helpers.tpl +++ b/stable/percona-xtradb-cluster/templates/_helpers.tpl @@ -23,3 +23,11 @@ https://www.percona.com/doc/percona-xtradb-cluster/LATEST/wsrep-system-index.htm {{- $name := default "pxc" .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 32 | trimSuffix "-" -}} {{- end -}} + +{{- define "percona-xtradb-cluster.statefulset.apiVersion" -}} +{{- if .Capabilities.APIVersions.Has "apps/v1/StatefulSet" -}} +{{- print "apps/v1" -}} +{{- else -}} +{{- print "apps/v1beta2" -}} +{{- end -}} +{{- end -}} diff --git a/stable/percona-xtradb-cluster/templates/statefulset.yaml b/stable/percona-xtradb-cluster/templates/statefulset.yaml index 4e15f8efc0..7bfc69e6be 100644 --- a/stable/percona-xtradb-cluster/templates/statefulset.yaml +++ b/stable/percona-xtradb-cluster/templates/statefulset.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1beta2 +apiVersion: {{ template "percona-xtradb-cluster.statefulset.apiVersion" . }} kind: StatefulSet metadata: name: {{ template "percona-xtradb-cluster.fullname" . }}