Skip to content

Commit

Permalink
Changing terminating gateway to pass acl-init a -component-name flag …
Browse files Browse the repository at this point in the history
…in the form of terminating-gateway/RELEASE-NAME-consul-terminating - <component type>/<consul fullname>-<name>
  • Loading branch information
jmurret committed Mar 17, 2022
1 parent e56b3ae commit a2df993
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions charts/consul/templates/terminating-gateways-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ spec:
- name: CONSUL_HTTP_ADDR
value: http://$(HOST_IP):8500
{{- end }}
command:
command:
- "/bin/sh"
- "-ec"
- |
{{- if $root.Values.global.acls.manageSystemACLs }}
consul-k8s-control-plane acl-init \
-component-name=terminating-gateway \
-component-name=terminating-gateway/{{ template "consul.fullname" $root }}-{{ .name }} \
-acl-auth-method={{ template "consul.fullname" $root }}-k8s-component-auth-method \
{{- if $root.Values.global.adminPartitions.enabled }}
-partition={{ $root.Values.global.adminPartitions.name }} \
Expand Down
5 changes: 3 additions & 2 deletions charts/consul/test/unit/terminating-gateways-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1156,11 +1156,12 @@ EOF
--set 'terminatingGateways.enabled=true' \
--set 'connectInject.enabled=true' \
--set 'global.acls.manageSystemACLs=true' \
--set 'terminatingGateways.gateways[0].name=terminating' \
. | tee /dev/stderr |
yq -s -r '.[0].spec.template.spec.initContainers | map(select(.name == "terminating-gateway-init"))[0] | .command[2]' | tee /dev/stderr)

exp='consul-k8s-control-plane acl-init \
-component-name=terminating-gateway \
-component-name=terminating-gateway/RELEASE-NAME-consul-terminating \
-acl-auth-method=RELEASE-NAME-consul-k8s-component-auth-method \
-token-sink-file=/consul/service/acl-token \
-log-level=info \
Expand All @@ -1169,7 +1170,7 @@ EOF
cat > /consul/service/service.hcl << EOF
service {
kind = "terminating-gateway"
name = "terminating-gateway"
name = "terminating"
id = "${POD_NAME}"
address = "${POD_IP}"
port = 8443
Expand Down

0 comments on commit a2df993

Please sign in to comment.