From 07853d2ba07338d70374bc419c68e7f7a90c166a Mon Sep 17 00:00:00 2001 From: Xiang Dai <764524258@qq.com> Date: Mon, 30 Sep 2019 14:51:37 +0800 Subject: [PATCH] Fixes compatibility with 1.16 (#17535) Signed-off-by: Xiang Dai <764524258@qq.com> --- stable/rocketchat/Chart.yaml | 2 +- stable/rocketchat/templates/_helpers.tpl | 11 +++++++++++ stable/rocketchat/templates/deployment.yaml | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/stable/rocketchat/Chart.yaml b/stable/rocketchat/Chart.yaml index 2f3ebdc786..d4e5aafbe9 100644 --- a/stable/rocketchat/Chart.yaml +++ b/stable/rocketchat/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: rocketchat -version: 1.1.12 +version: 1.1.13 appVersion: 1.3.1 description: Prepare to take off with the ultimate chat platform, experience the next level of team communications keywords: diff --git a/stable/rocketchat/templates/_helpers.tpl b/stable/rocketchat/templates/_helpers.tpl index 45320400fa..4b0d1ca1c1 100644 --- a/stable/rocketchat/templates/_helpers.tpl +++ b/stable/rocketchat/templates/_helpers.tpl @@ -40,3 +40,14 @@ Create the name of the service account to use {{ default "default" .Values.serviceAccount.name }} {{- end -}} {{- end -}} + +{{/* +Return the apiVerion of deployment. +*/}} +{{- define "deployment.apiVersion" -}} +{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "extensions/v1beta1" -}} +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "apps/v1" -}} +{{- end -}} +{{- end -}} diff --git a/stable/rocketchat/templates/deployment.yaml b/stable/rocketchat/templates/deployment.yaml index 290b03a101..5d18c9efcb 100644 --- a/stable/rocketchat/templates/deployment.yaml +++ b/stable/rocketchat/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: {{ template "deployment.apiVersion" . }} kind: Deployment metadata: name: {{ template "rocketchat.fullname" . }}