From 61a036dc34a401c8c296f56efcc0441021f90ff5 Mon Sep 17 00:00:00 2001 From: Iristyle Date: Fri, 7 Jan 2022 13:50:34 -0800 Subject: [PATCH] Add volumes and env vars to helm hook test pod - Uses the same extraEnvironmentVars, volumes and volumeMounts set on the server statefulset to configure the Vault server test pod used by the helm test hook - This is necessary in situations where TLS is configured, but the certificates are not affiliated with the k8s CA / part of k8s PKI - Fixes GH-665 --- templates/tests/server-test.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/tests/server-test.yaml b/templates/tests/server-test.yaml index 66aa178f5..92402098a 100644 --- a/templates/tests/server-test.yaml +++ b/templates/tests/server-test.yaml @@ -1,3 +1,4 @@ +{{ template "vault.mode" . }} {{- if .Values.server.enabled }} apiVersion: v1 kind: Pod @@ -15,6 +16,7 @@ spec: env: - name: VAULT_ADDR value: {{ include "vault.scheme" . }}://{{ template "vault.fullname" . }}.{{ .Release.Namespace }}.svc:{{ .Values.server.service.port }} + {{- include "vault.extraEnvironmentVars" .Values.server | nindent 12 }} command: - /bin/sh - -c @@ -35,6 +37,9 @@ spec: fi exit 0 - + volumeMounts: + {{ template "vault.mounts" . }} + volumes: + {{ template "vault.volumes" . }} restartPolicy: Never {{- end }}