Skip to content

Commit

Permalink
connect: redirect-traffic command should pass ACL token when ACL are …
Browse files Browse the repository at this point in the history
…enabled (#576)

Fixes #570,#568
  • Loading branch information
ishustava committed Jul 30, 2021
1 parent 81c05aa commit 4a50fda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions connect-inject/container_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ consul-k8s connect-init -pod-name=${POD_NAME} -pod-namespace=${POD_NAMESPACE} \
# Apply traffic redirection rules.
/consul/connect-inject/consul connect redirect-traffic \
{{- if .AuthMethod }}
-token-file="/consul/connect-inject/acl-token" \
{{- end }}
{{- if .ConsulNamespace }}
-namespace="{{ .ConsulNamespace }}" \
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions connect-inject/container_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ consul-k8s connect-init -pod-name=${POD_NAME} -pod-namespace=${POD_NAMESPACE} \
# Apply traffic redirection rules.
/consul/connect-inject/consul connect redirect-traffic \
-token-file="/consul/connect-inject/acl-token" \
-namespace="k8snamespace" \
-proxy-id="$(cat /consul/connect-inject/proxyid)" \
-proxy-uid=5995`,
Expand Down

0 comments on commit 4a50fda

Please sign in to comment.