From 9e63cde43eafed7de2080fe3d08cc876eda399d9 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Mon, 11 Nov 2019 21:19:42 +0530 Subject: [PATCH] [stable/kubewatch] bump major version (#18712) Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec. In https://github.com/helm/charts/pull/17285 the `apiVersion` of the deployment resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage. This major version signifies this change. Signed-off-by: Sameer Naik --- stable/kubewatch/Chart.yaml | 2 +- stable/kubewatch/README.md | 10 ++++++++++ stable/kubewatch/templates/_helpers.tpl | 11 +++++++++++ stable/kubewatch/templates/deployment.yaml | 2 +- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/stable/kubewatch/Chart.yaml b/stable/kubewatch/Chart.yaml index 2b65bd0a4e..48bc218613 100644 --- a/stable/kubewatch/Chart.yaml +++ b/stable/kubewatch/Chart.yaml @@ -1,5 +1,5 @@ name: kubewatch -version: 0.8.13 +version: 1.0.0 apiVersion: v1 appVersion: 0.0.4 home: https://github.com/bitnami-labs/kubewatch diff --git a/stable/kubewatch/README.md b/stable/kubewatch/README.md index 40560eac90..0e00adcf1d 100644 --- a/stable/kubewatch/README.md +++ b/stable/kubewatch/README.md @@ -117,3 +117,13 @@ Open [https://my.slack.com/services/new/bot](https://my.slack.com/services/new/b The API token can be found on the edit page (it starts with `xoxb-`). Invite the Bot to your channel by typing `/join @name_of_your_bot` in the Slack message area. + +## Upgrading + +### To 1.0.0 + +Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec. + +In https://github.com/helm/charts/pull/17285 the `apiVersion` of the deployment resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage. + +This major version signifies this change. diff --git a/stable/kubewatch/templates/_helpers.tpl b/stable/kubewatch/templates/_helpers.tpl index 357b50b841..9653f5abd5 100644 --- a/stable/kubewatch/templates/_helpers.tpl +++ b/stable/kubewatch/templates/_helpers.tpl @@ -93,3 +93,14 @@ imagePullSecrets: {{- end }} {{- end -}} {{- end -}} + +{{/* +Return the appropriate apiVersion for deployment. +*/}} +{{- define "kubewatch.deployment.apiVersion" -}} +{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "apps/v1beta2" -}} +{{- else -}} +{{- print "apps/v1" -}} +{{- end -}} +{{- end -}} diff --git a/stable/kubewatch/templates/deployment.yaml b/stable/kubewatch/templates/deployment.yaml index 91c53cb6a1..5f85cb80e2 100644 --- a/stable/kubewatch/templates/deployment.yaml +++ b/stable/kubewatch/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 +apiVersion: {{ template "kubewatch.deployment.apiVersion" . }} kind: Deployment metadata: labels: