Fix hardcoded service name in raft enfv (#240)

This commit is contained in:
Jason O'Donnell 2020-03-26 17:19:26 -04:00 committed by GitHub
parent ac64feb0eb
commit e97f4a579f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View file

@ -135,7 +135,7 @@ Set's additional environment variables based on the mode.
{{ end }}
{{ if and (eq .mode "ha") (eq (.Values.server.ha.raft.enabled | toString) "true") }}
- name: VAULT_CLUSTER_ADDR
value: "https://$(HOSTNAME).vault-internal:8201"
value: "https://$(HOSTNAME).{{ template "vault.fullname" . }}-internal:8201"
{{ end }}
{{- end -}}

View file

@ -403,6 +403,28 @@ load _helpers
[ "${actual}" = "secret_key_1" ]
}
#--------------------------------------------------------------------
# VAULT_CLUSTER_ADDR renders
@test "server/ha-StatefulSet: cluster addr renders" {
cd `chart_dir`
local object=$(helm template \
--show-only templates/server-statefulset.yaml \
--set 'server.ha.enabled=true' \
--set 'server.ha.raft.enabled=true' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.containers[0].env' | tee /dev/stderr)
local actual=$(echo $object |
yq -r '.[7].name' | tee /dev/stderr)
[ "${actual}" = "VAULT_CLUSTER_ADDR" ]
local actual=$(echo $object |
yq -r '.[7].value' | tee /dev/stderr)
[ "${actual}" = 'https://$(HOSTNAME).RELEASE-NAME-vault-internal:8201' ]
}
#--------------------------------------------------------------------
# storage class