From e5ab717deb470e6652712e3789417628ebdcc277 Mon Sep 17 00:00:00 2001 From: jessebot Date: Fri, 8 Dec 2023 10:56:09 +0100 Subject: [PATCH] attempt to fix user certs with _ in the name to have - in the secret and cert name --- charts/cloudnative-pg-cluster/Chart.yaml | 2 +- charts/cloudnative-pg-cluster/README.md | 2 +- .../templates/user_certificates.yaml | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/charts/cloudnative-pg-cluster/Chart.yaml b/charts/cloudnative-pg-cluster/Chart.yaml index b261995..ccb295d 100644 --- a/charts/cloudnative-pg-cluster/Chart.yaml +++ b/charts/cloudnative-pg-cluster/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: cnpg-cluster description: Create postgres tenant clusters managed by the CNPG Operator type: application -version: 0.3.10 +version: 0.3.11 maintainers: - name: "cloudymax" diff --git a/charts/cloudnative-pg-cluster/README.md b/charts/cloudnative-pg-cluster/README.md index 127f076..54f89d4 100644 --- a/charts/cloudnative-pg-cluster/README.md +++ b/charts/cloudnative-pg-cluster/README.md @@ -1,6 +1,6 @@ # cnpg-cluster -![Version: 0.3.10](https://img.shields.io/badge/Version-0.3.10-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 0.3.11](https://img.shields.io/badge/Version-0.3.11-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) Create postgres tenant clusters managed by the CNPG Operator diff --git a/charts/cloudnative-pg-cluster/templates/user_certificates.yaml b/charts/cloudnative-pg-cluster/templates/user_certificates.yaml index 084db65..2ddf402 100644 --- a/charts/cloudnative-pg-cluster/templates/user_certificates.yaml +++ b/charts/cloudnative-pg-cluster/templates/user_certificates.yaml @@ -1,19 +1,20 @@ {{- if and .Values.certificates.user.enabled }} {{- range .Values.certificates.user.username }} +{{- $username := . | replace "_" "-" -}} --- apiVersion: v1 kind: Secret metadata: - name: "{{ $.Values.name }}-{{ . }}-cert" + name: "{{ $.Values.name }}-{{ $username }}-cert" labels: cnpg.io/reload: "" --- apiVersion: cert-manager.io/v1 kind: Certificate metadata: - name: "{{ $.Values.name }}-{{ . }}-cert" + name: "{{ $.Values.name }}-{{ $username }}-cert" spec: - secretName: "{{ $.Values.name }}-{{ . }}-cert" + secretName: "{{ $.Values.name }}-{{ $username }}-cert" usages: - client auth commonName: {{ . }}