-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add traffic permissions integration tests. #19008
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,30 @@ | |
# SPDX-License-Identifier: BUSL-1.1 | ||
|
||
ARG CONSUL_DATAPLANE_IMAGE | ||
ARG CONSUL_IMAGE | ||
|
||
# Docker doesn't support expansion in COPY --copy, so we need to create an intermediate image. | ||
FROM ${CONSUL_IMAGE} as consul | ||
|
||
FROM ${CONSUL_DATAPLANE_IMAGE} as consuldataplane | ||
COPY --from=busybox:uclibc /bin/sh /bin/sh | ||
COPY --from=ghcr.io/tarampampam/curl:latest /bin/curl /bin/curl | ||
|
||
USER root | ||
|
||
# On Mac M1s when TProxy is enabled, consul-dataplane that are spawned from this image | ||
# (only used in consul-container integration tests) will terminate with the below error. | ||
# It is related to tproxy-startup.sh calling iptables SDK which then calls the underly | ||
# iptables. We are investigating how this works on M1s with consul-envoy images which | ||
# do not have this problem. For the time being tproxy tests on Mac M1s will fail locally | ||
# but pass in CI. | ||
# | ||
# Error setting up traffic redirection rules: failed to run command: /sbin/iptables -t nat -N CONSUL_PROXY_INBOUND, err: exit status 1, output: iptables: Failed to initialize nft: Protocol not supported | ||
RUN microdnf install -y iptables sudo nc \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a note for something like: On Mac M1s when TProxy is enabled, consul-dataplane that are spawned from this image (only used in consul-container integration tests) will terminate with the below error. It is related to tproxy-startup.sh calling iptables SDK which then calls the underly iptables. We are investigating how this works on M1s with consul-envoy images which do not have this problem. For the time being tproxy tests on Mac M1s will fail locally but pass in CI. Error setting up traffic redirection rules: failed to run command: /sbin/iptables -t nat -N CONSUL_PROXY_INBOUND, err: exit status 1, output: iptables: Failed to initialize nft: Protocol not supported |
||
&& usermod -a -G wheel consul-dataplane \ | ||
&& echo 'consul-dataplane ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
|
||
COPY --from=consul /bin/consul /bin/consul | ||
|
||
COPY tproxy-startup.sh /bin/tproxy-startup.sh | ||
RUN chmod +x /bin/tproxy-startup.sh && chown root:root /bin/tproxy-startup.sh | ||
|
||
USER 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't particularly like this, but it's hard to do much better without making a breaking change that impacts tons and tons of tests.