From 75accbbf87ef6381e56fd8d1e797eb7cea208b62 Mon Sep 17 00:00:00 2001 From: alexlebens Date: Wed, 17 Apr 2024 20:00:06 -0600 Subject: [PATCH] use semver function to pull major version into cluster name --- charts/postgres-cluster/Chart.yaml | 2 +- charts/postgres-cluster/templates/_helpers.tpl | 2 +- charts/postgres-cluster/values.yaml | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index 9841544..c00fdd6 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -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 diff --git a/charts/postgres-cluster/templates/_helpers.tpl b/charts/postgres-cluster/templates/_helpers.tpl index f3c3f25..e13ec62 100644 --- a/charts/postgres-cluster/templates/_helpers.tpl +++ b/charts/postgres-cluster/templates/_helpers.tpl @@ -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 }} diff --git a/charts/postgres-cluster/values.yaml b/charts/postgres-cluster/values.yaml index 8bb7f99..16dec47 100644 --- a/charts/postgres-cluster/values.yaml +++ b/charts/postgres-cluster/values.yaml @@ -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