Quote .server.ha.clusterAddr value (#810)

This commit is contained in:
Steven Kriegler 2022-11-09 23:19:38 +01:00 committed by GitHub
parent ab5b471c27
commit 0110f977b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View file

@ -3,6 +3,9 @@
Features: Features:
* server: Add `extraLabels` for Vault server serviceAccount [GH-806](https://github.com/hashicorp/vault-helm/pull/806) * server: Add `extraLabels` for Vault server serviceAccount [GH-806](https://github.com/hashicorp/vault-helm/pull/806)
Bugs:
* server: Quote `.server.ha.clusterAddr` value [GH-810](https://github.com/hashicorp/vault-helm/pull/810)
## 0.22.1 (October 26th, 2022) ## 0.22.1 (October 26th, 2022)
Changes: Changes:

View file

@ -106,7 +106,7 @@ spec:
fieldPath: metadata.name fieldPath: metadata.name
- name: VAULT_CLUSTER_ADDR - name: VAULT_CLUSTER_ADDR
{{- if .Values.server.ha.clusterAddr }} {{- if .Values.server.ha.clusterAddr }}
value: {{ .Values.server.ha.clusterAddr }} value: {{ .Values.server.ha.clusterAddr | quote }}
{{- else }} {{- else }}
value: "https://$(HOSTNAME).{{ template "vault.fullname" . }}-internal:8201" value: "https://$(HOSTNAME).{{ template "vault.fullname" . }}-internal:8201"
{{- end }} {{- end }}

View file

@ -476,6 +476,22 @@ load _helpers
[ "${value}" = 'http://$(HOSTNAME).release-name-vault-internal:8201' ] [ "${value}" = 'http://$(HOSTNAME).release-name-vault-internal:8201' ]
} }
@test "server/ha-StatefulSet: clusterAddr gets quoted" {
cd `chart_dir`
local customUrl='http://$(HOSTNAME).release-name-vault-internal:8201'
local rendered=$(helm template \
--show-only templates/server-statefulset.yaml \
--set 'server.ha.enabled=true' \
--set 'server.ha.raft.enabled=true' \
--set "server.ha.clusterAddr=${customUrl}" \
. | tee /dev/stderr | \
grep -F "${customUrl}" | tee /dev/stderr)
local value=$(echo $rendered |
yq -Y '.' | tee /dev/stderr)
[ "${value}" = 'value: "http://$(HOSTNAME).release-name-vault-internal:8201"' ]
}
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# VAULT_RAFT_NODE_ID renders # VAULT_RAFT_NODE_ID renders