Skip to content

Commit 9b26d17

Browse files
authored
Update envoy docker image used in integration tests (envoyproxy#223)
Signed-off-by: rulex123 <[email protected]>
1 parent 8e3a323 commit 9b26d17

File tree

7 files changed

+13
-26
lines changed

7 files changed

+13
-26
lines changed

server/src/test/java/io/envoyproxy/controlplane/server/EnvoyContainer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ class EnvoyContainer extends GenericContainer<EnvoyContainer> {
1313
private static final Logger LOGGER = LoggerFactory.getLogger(EnvoyContainer.class);
1414

1515
private static final String CONFIG_DEST = "/etc/envoy/envoy.yaml";
16-
private static final String HOST_IP_SCRIPT = "docker/host_ip.sh";
17-
private static final String HOST_IP_SCRIPT_DEST = "/usr/local/bin/host_ip.sh";
1816
private static final String LAUNCH_ENVOY_SCRIPT = "envoy/launch_envoy.sh";
1917
private static final String LAUNCH_ENVOY_SCRIPT_DEST = "/usr/local/bin/launch_envoy.sh";
2018

@@ -26,7 +24,7 @@ class EnvoyContainer extends GenericContainer<EnvoyContainer> {
2624
EnvoyContainer(String config, Supplier<Integer> controlPlanePortSupplier) {
2725
// this version is changed automatically by /tools/update-sha.sh:57
2826
// if you change it make sure to reflect changes there
29-
super("envoyproxy/envoy-alpine-dev:af50070ee60866874b0a9383daf9364e884ded22");
27+
super("envoyproxy/envoy-dev:af50070ee60866874b0a9383daf9364e884ded22");
3028
this.config = config;
3129
this.controlPlanePortSupplier = controlPlanePortSupplier;
3230
}
@@ -35,12 +33,13 @@ class EnvoyContainer extends GenericContainer<EnvoyContainer> {
3533
protected void configure() {
3634
super.configure();
3735

38-
withClasspathResourceMapping(HOST_IP_SCRIPT, HOST_IP_SCRIPT_DEST, BindMode.READ_ONLY);
3936
withClasspathResourceMapping(LAUNCH_ENVOY_SCRIPT, LAUNCH_ENVOY_SCRIPT_DEST, BindMode.READ_ONLY);
4037
withClasspathResourceMapping(config, CONFIG_DEST, BindMode.READ_ONLY);
4138

39+
withExtraHost("host.docker.internal","host-gateway");
40+
4241
withCommand(
43-
"/bin/sh", "/usr/local/bin/launch_envoy.sh",
42+
"/bin/bash", "/usr/local/bin/launch_envoy.sh",
4443
Integer.toString(controlPlanePortSupplier.get()),
4544
CONFIG_DEST,
4645
"-l", "debug"
@@ -55,4 +54,5 @@ protected void containerIsStarting(InspectContainerResponse containerInfo) {
5554

5655
super.containerIsStarting(containerInfo);
5756
}
57+
5858
}

server/src/test/java/io/envoyproxy/controlplane/server/V3DiscoveryServerAdsIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import io.restassured.http.ContentType;
1414
import java.util.concurrent.CountDownLatch;
1515
import java.util.concurrent.TimeUnit;
16+
1617
import org.junit.ClassRule;
1718
import org.junit.Test;
1819
import org.junit.rules.RuleChain;

server/src/test/resources/docker/host_ip.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

server/src/test/resources/envoy/ads.v3.config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ node:
2121
static_resources:
2222
clusters:
2323
- connect_timeout: 1s
24+
type: STRICT_DNS
2425
load_assignment:
2526
cluster_name: ads_server
2627
endpoints:
2728
- lb_endpoints:
2829
- endpoint:
2930
address:
3031
socket_address:
31-
address: HOST_IP
32+
address: host.docker.internal
3233
port_value: HOST_PORT
3334
http2_protocol_options: {}
3435
name: ads_cluster

server/src/test/resources/envoy/launch_envoy.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -eu
44

5-
HOST_IP=$(sh /usr/local/bin/host_ip.sh)
65
HOST_PORT=$1
76

87
CONFIG=$(cat $2)
98
CONFIG_DIR=$(mktemp -d)
109
CONFIG_FILE="$CONFIG_DIR/envoy.yaml"
1110

12-
echo "${CONFIG}" | sed -e "s/HOST_IP/${HOST_IP}/g" -e "s/HOST_PORT/${HOST_PORT}/g" > "${CONFIG_FILE}"
11+
echo "${CONFIG}" | sed -e "s/HOST_PORT/${HOST_PORT}/g" > "${CONFIG_FILE}"
1312
cat "${CONFIG_FILE}"
1413

1514
shift 2

server/src/test/resources/envoy/xds.v3.config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ node:
2525
static_resources:
2626
clusters:
2727
- connect_timeout: 1s
28+
type: STRICT_DNS
2829
load_assignment:
2930
cluster_name: xds_cluster
3031
endpoints:
3132
- lb_endpoints:
3233
- endpoint:
3334
address:
3435
socket_address:
35-
address: HOST_IP
36+
address: host.docker.internal
3637
port_value: HOST_PORT
3738
http2_protocol_options: {}
3839
name: xds_cluster

tools/update-sha.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ UDPA_SHA=\"$UDPA_SHA\" # $UDPA_DATE
5959
"
6060

6161
# replace version in EnvoyContainer.java
62-
sed -i 's/\(envoy-alpine-dev:\).*\(\");\)/\1'"$ENVOY_VERSION"'\2/g' ../server/src/test/java/io/envoyproxy/controlplane/server/EnvoyContainer.java
62+
sed -i 's/\(envoy-dev:\).*\(\");\)/\1'"$ENVOY_VERSION"'\2/g' ../server/src/test/java/io/envoyproxy/controlplane/server/EnvoyContainer.java
6363

6464
# update tag in envoy_release file
6565
echo $1 > enovy_release

0 commit comments

Comments
 (0)