diff --git a/stable/postgresql/Chart.yaml b/stable/postgresql/Chart.yaml index 167b1dd2a6..c49ff3ae90 100644 --- a/stable/postgresql/Chart.yaml +++ b/stable/postgresql/Chart.yaml @@ -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: diff --git a/stable/postgresql/README.md b/stable/postgresql/README.md index 8241807fa9..de3cd3708c 100644 --- a/stable/postgresql/README.md +++ b/stable/postgresql/README.md @@ -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 diff --git a/stable/postgresql/templates/_helpers.tpl b/stable/postgresql/templates/_helpers.tpl index dc10dc025f..b379f2913a 100644 --- a/stable/postgresql/templates/_helpers.tpl +++ b/stable/postgresql/templates/_helpers.tpl @@ -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 -}} diff --git a/stable/postgresql/templates/statefulset-slaves.yaml b/stable/postgresql/templates/statefulset-slaves.yaml index de796ccaf5..74a81d0c34 100644 --- a/stable/postgresql/templates/statefulset-slaves.yaml +++ b/stable/postgresql/templates/statefulset-slaves.yaml @@ -1,5 +1,5 @@ {{- if .Values.replication.enabled }} -apiVersion: apps/v1 +apiVersion: {{ template "postgresql.statefulset.apiVersion" . }} kind: StatefulSet metadata: name: "{{ template "postgresql.fullname" . }}-slave" diff --git a/stable/postgresql/templates/statefulset.yaml b/stable/postgresql/templates/statefulset.yaml index 2b679da82d..64c297f559 100644 --- a/stable/postgresql/templates/statefulset.yaml +++ b/stable/postgresql/templates/statefulset.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 +apiVersion: {{ template "postgresql.statefulset.apiVersion" . }} kind: StatefulSet metadata: name: {{ template "postgresql.master.fullname" . }}