From 8c1dd3c5760b0cb5aa056898f2ef8d491ac52e78 Mon Sep 17 00:00:00 2001
From: Philippe Scorsolini
Date: Mon, 30 Oct 2023 11:05:54 +0100
Subject: [PATCH] fix: avoid setting configmap name with config.secret=true
Signed-off-by: Philippe Scorsolini
---
charts/cloudnative-pg/templates/deployment.yaml | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/charts/cloudnative-pg/templates/deployment.yaml b/charts/cloudnative-pg/templates/deployment.yaml
index 6bdcf06e2..45619fa70 100644
--- a/charts/cloudnative-pg/templates/deployment.yaml
+++ b/charts/cloudnative-pg/templates/deployment.yaml
@@ -49,9 +49,12 @@ spec:
- args:
- controller
- --leader-elect
- {{- with .Values.config.name }}
- - --config-map-name={{ . }}
- - --secret-name={{ . }}
+ {{- if .Values.config.name }}
+ {{- if not .Values.config.secret }}
+ - --config-map-name={{ .Values.config.name }}
+ {{- else }}
+ - --secret-name={{ .Values.config.name }}
+ {{- end }}
{{- end }}
- --webhook-port={{ .Values.webhook.port }}
{{- range .Values.additionalArgs }}