From cdd1eaac4f1ae9bdfee38dd0a3a4bba9e4d9b69c Mon Sep 17 00:00:00 2001 From: Nicholas Weidmann Date: Tue, 15 Oct 2024 14:01:15 +0200 Subject: [PATCH] fix extraconfig-from-values.hcl condition mismatch --- templates/_helpers.tpl | 4 ++-- templates/server-config-configmap.yaml | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 2f90ecbdc..c60ae15d0 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -183,7 +183,7 @@ defined a custom configuration. Additionally iterates over any extra volumes the user may have specified (such as a secret with TLS). */}} {{- define "vault.volumes" -}} - {{- if and (ne .mode "dev") (or (.Values.server.standalone.config) (.Values.server.ha.config) (.Values.server.ha.raft.config)) }} + {{- if and (ne .mode "dev") (ne .mode "external") (.serverEnabled) (or (.Values.server.standalone.config) (.Values.server.ha.config) (.Values.server.ha.raft.config)) }} - name: config configMap: name: {{ template "vault.fullname" . }}-config @@ -215,7 +215,7 @@ file with IP addresses to make the out of box experience easier for users looking to use this chart with Consul Helm. */}} {{- define "vault.args" -}} - {{ if or (eq .mode "standalone") (eq .mode "ha") }} + {{ if and (ne .mode "dev") (ne .mode "external") (.serverEnabled) (or (.Values.server.standalone.config) (.Values.server.ha.config) (.Values.server.ha.raft.config)) }} - | cp /vault/config/extraconfig-from-values.hcl /tmp/storageconfig.hcl; [ -n "${HOST_IP}" ] && sed -Ei "s|HOST_IP|${HOST_IP?}|g" /tmp/storageconfig.hcl; diff --git a/templates/server-config-configmap.yaml b/templates/server-config-configmap.yaml index 1fed2e690..1d83c6ae7 100644 --- a/templates/server-config-configmap.yaml +++ b/templates/server-config-configmap.yaml @@ -4,10 +4,7 @@ SPDX-License-Identifier: MPL-2.0 */}} {{ template "vault.mode" . }} -{{- if ne .mode "external" }} -{{- if .serverEnabled -}} -{{- if ne .mode "dev" -}} -{{ if or (.Values.server.standalone.config) (.Values.server.ha.config) -}} +{{- if and (ne .mode "dev") (ne .mode "external") (.serverEnabled) (or (.Values.server.standalone.config) (.Values.server.ha.config) (.Values.server.ha.raft.config)) }} apiVersion: v1 kind: ConfigMap metadata: @@ -26,6 +23,3 @@ data: extraconfig-from-values.hcl: |- {{ template "vault.config" . }} {{- end }} -{{- end }} -{{- end }} -{{- end }}