From a2df993c19372ee865461ca35ed548004310bd90 Mon Sep 17 00:00:00 2001 From: John Murret Date: Thu, 17 Mar 2022 17:02:40 -0600 Subject: [PATCH] Changing terminating gateway to pass acl-init a -component-name flag in the form of terminating-gateway/RELEASE-NAME-consul-terminating - /- --- charts/consul/templates/terminating-gateways-deployment.yaml | 4 ++-- charts/consul/test/unit/terminating-gateways-deployment.bats | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/consul/templates/terminating-gateways-deployment.yaml b/charts/consul/templates/terminating-gateways-deployment.yaml index 2223108aae..4fb5c40f5f 100644 --- a/charts/consul/templates/terminating-gateways-deployment.yaml +++ b/charts/consul/templates/terminating-gateways-deployment.yaml @@ -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 }} \ diff --git a/charts/consul/test/unit/terminating-gateways-deployment.bats b/charts/consul/test/unit/terminating-gateways-deployment.bats index 8f09157b9f..4e7bc75391 100644 --- a/charts/consul/test/unit/terminating-gateways-deployment.bats +++ b/charts/consul/test/unit/terminating-gateways-deployment.bats @@ -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 \ @@ -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