From 0acafc8281a0ee0a8d29d259cd309d208fa52683 Mon Sep 17 00:00:00 2001 From: Greg Hecquet Date: Tue, 2 Jul 2024 15:03:34 +0200 Subject: [PATCH] Helm template update --- tools/kubernetes/cells/templates/configmap.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/kubernetes/cells/templates/configmap.yaml b/tools/kubernetes/cells/templates/configmap.yaml index f4485714ea..52adc46d2a 100644 --- a/tools/kubernetes/cells/templates/configmap.yaml +++ b/tools/kubernetes/cells/templates/configmap.yaml @@ -85,11 +85,17 @@ data: EXIT_STATUS=$? if echo \"$VAULT_STATUS\" | grep '"initialized": false'; then - vault operator init -n 1 -t 1 >> ${OUTPUT?} + if echo \"$VAULT_STATUS\" | grep '"type": "shamir"'; then + vault operator init -n 1 -t 1 >> ${OUTPUT?} + + unseal=$(cat ${OUTPUT?} | grep "Unseal Key 1:" | sed -e "s/Unseal Key 1: //g") + vault operator unseal ${unseal?} + else + vault operator init >> ${OUTPUT?} + fi + root=$(cat ${OUTPUT?} | grep "Initial Root Token:" | sed -e "s/Initial Root Token: //g") - unseal=$(cat ${OUTPUT?} | grep "Unseal Key 1:" | sed -e "s/Unseal Key 1: //g") - vault operator unseal ${unseal?} vault login -no-print ${root?} vault secrets enable -version=2 -path=secret kv