Skip to content

Commit

Permalink
[stable/postgresql] bump major version (helm#18707)
Browse files Browse the repository at this point in the history
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 helm#17281 the `apiVersion` of the statefulset resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage.

This major version bump signifies this change.

Signed-off-by: Sameer Naik <sameersbn@vmware.com>
  • Loading branch information
Sameer Naik authored and dargolith committed Jan 10, 2020
1 parent 5c8ef82 commit d4b5ba3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stable/postgresql/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: postgresql
version: 6.6.0
version: 7.0.0
appVersion: 11.5.0
description: Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance.
keywords:
Expand Down
7 changes: 7 additions & 0 deletions stable/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,13 @@ $ helm upgrade my-release bitnami/influxdb \

> Note: you need to substitute the placeholders _[POSTGRESQL_PASSWORD]_, and _[REPLICATION_PASSWORD]_ with the values obtained from instructions in the installation notes.
## 7.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/17281 the `apiVersion` of the statefulset resources was updated to `apps/v1` in tune with the api's deprecated, resulting in compatibility breakage.

This major version bump signifies this change.

## 5.0.0

Expand Down
11 changes: 11 additions & 0 deletions stable/postgresql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,14 @@ Usage:
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}

{{/*
Return the appropriate apiVersion for statefulset.
*/}}
{{- define "postgresql.statefulset.apiVersion" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "apps/v1beta2" -}}
{{- else -}}
{{- print "apps/v1" -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion stable/postgresql/templates/statefulset-slaves.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.replication.enabled }}
apiVersion: apps/v1
apiVersion: {{ template "postgresql.statefulset.apiVersion" . }}
kind: StatefulSet
metadata:
name: "{{ template "postgresql.fullname" . }}-slave"
Expand Down
2 changes: 1 addition & 1 deletion stable/postgresql/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1
apiVersion: {{ template "postgresql.statefulset.apiVersion" . }}
kind: StatefulSet
metadata:
name: {{ template "postgresql.master.fullname" . }}
Expand Down

0 comments on commit d4b5ba3

Please sign in to comment.