Skip to content

Commit

Permalink
Quote .server.ha.clusterAddr value (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
justusbunsi authored Nov 9, 2022
1 parent ab5b471 commit 0110f97
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
Features:
* 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)

Changes:
Expand Down
2 changes: 1 addition & 1 deletion templates/server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ spec:
fieldPath: metadata.name
- name: VAULT_CLUSTER_ADDR
{{- if .Values.server.ha.clusterAddr }}
value: {{ .Values.server.ha.clusterAddr }}
value: {{ .Values.server.ha.clusterAddr | quote }}
{{- else }}
value: "https://$(HOSTNAME).{{ template "vault.fullname" . }}-internal:8201"
{{- end }}
Expand Down
16 changes: 16 additions & 0 deletions test/unit/server-ha-statefulset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,22 @@ load _helpers
[ "${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

Expand Down

0 comments on commit 0110f97

Please # to comment.