use semver function to pull major version into cluster name

This commit is contained in:
2024-04-17 20:00:06 -06:00
parent 19fbd95a79
commit 75accbbf87
3 changed files with 3 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v2
name: postgres-cluster
version: 2.2.1
version: 2.2.2
description: Chart for cloudnative-pg cluster
keywords:
- database

View File

@@ -5,7 +5,7 @@ Expand the name of the chart.
{{- if .Values.nameOverride }}
{{- .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "postgresql-%s-%s" .Values.cluster.image.majorVersion .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- printf "postgresql-%s-%s" ((semver .Values.cluster.image.tag).Major | toString) .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end }}
{{- end }}

View File

@@ -23,8 +23,7 @@ cluster:
image:
repository: ghcr.io/cloudnative-pg/postgresql
tag: "16.2"
majorVersion: "16"
tag: "16.2-13"
pullPolicy: IfNotPresent
# The UID and GID of the postgres user inside the image