Skip to content

Commit

Permalink
Add CONSUL_TLS_SERVER_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Eckert committed Nov 10, 2022
1 parent b81790c commit 57571e7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ spec:
value: {{ template "consul.fullname" . }}-server:8500
{{- end }}
{{- end }}
- name: CONSUL_HTTP_SSL
value: {{ .Values.global.tls.enabled }}
{{- if and .Values.externalServers.enabled .Values.externalServers.tlsServerName }}
- name: CONSUL_TLS_SERVER_NAME
value: {{ .Values.externalServers.tlsServerName }}
{{- end }}
command:
- "/bin/sh"
- "-ec"
Expand Down
19 changes: 19 additions & 0 deletions charts/consul/test/unit/api-gateway-controller-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1191,3 +1191,22 @@ load _helpers
[ "${actual}" = "true" ]
}

#--------------------------------------------------------------------
# externalServers tlsServerName

@test "apiGateway/Deployment: CONSUL_TLS_SERVER_NAME can be set for externalServers" {
cd `chart_dir`
local actual=$(helm template \
-s templates/api-gateway-controller-deployment.yaml \
--set 'apiGateway.enabled=true' \
--set 'apiGateway.image=bar' \
--set 'global.tls.enabled=true' \
--set 'externalServers.enabled=true' \
--set 'externalServers.hosts[0]=external-consul.host' \
--set 'externalServers.httpsPort=8501' \
--set 'externalServers.tlsServerName=hashi' \
--set 'server.enabled=false' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].env[4].value == "hashi"' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

0 comments on commit 57571e7

Please sign in to comment.