Skip to content

Commit

Permalink
[CONSUL-434] Modify Docker run functions in Helper script (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
cocolavayen authored and joselo85 committed Dec 21, 2022
1 parent 2a3b325 commit 45f272e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 8 additions & 6 deletions test/integration/connect/envoy/helpers.windows.bash
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,9 @@ function docker_consul_for_proxy_bootstrap {
local DC=$1
shift 1

docker.exe run -i --rm --network envoy-tests windows/consul:local "$@"
local CONTAINER_NAME="$SINGLE_CONTAINER_BASE_NAME"-"$DC"_1

docker.exe exec -i $CONTAINER_NAME bash.exe -c "$@"
}

function docker_wget {
Expand Down Expand Up @@ -773,13 +775,14 @@ function gen_envoy_bootstrap {
PROXY_ID="$SERVICE-sidecar-proxy"
fi

if output=$(docker_consul_for_proxy_bootstrap "$DC" connect envoy -bootstrap \
if output=$(docker_consul_for_proxy_bootstrap $DC "consul connect envoy -bootstrap \
-proxy-id $PROXY_ID \
-envoy-version "$ENVOY_VERSION" \
-http-addr envoy_consul-${DC}_1:8500 \
-grpc-addr envoy_consul-${DC}_1:8502 \
-admin-access-log-path="C:/envoy/envoy.log" \
-admin-bind 127.0.0.1:$ADMIN_PORT ${EXTRA_ENVOY_BS_ARGS}); then
-admin-bind 127.0.0.1:$ADMIN_PORT ${EXTRA_ENVOY_BS_ARGS} \
> /c/workdir/${DC}/envoy/${SERVICE}-bootstrap.json 2>&1"); then
# All OK, write config to file
echo "$output" > workdir/${DC}/envoy/$SERVICE-bootstrap.json
else
Expand All @@ -795,8 +798,7 @@ function read_config_entry {
local KIND=$1
local NAME=$2
local DC=${3:-primary}

docker_consul "$DC" config read -kind $KIND -name $NAME -http-addr="consul-$DC:8500"
docker_consul_exec "$DC" bash -c "consul config read -kind $KIND -name $NAME -http-addr="consul-$DC:8500""
}

function wait_for_namespace {
Expand Down Expand Up @@ -832,7 +834,7 @@ function setup_upsert_l4_intention {
local DESTINATION=$2
local ACTION=$3

retry_default docker_curl primary -sL -X PUT -d"{\"Action\": \"${ACTION}\"}" "http://consul-primary:8500/v1/connect/intentions/exact?source=${SOURCE}&destination=${DESTINATION}"
retry_default docker_consul_exec primary bash -c "curl -sL -X PUT -d '{\"Action\": \"${ACTION}\"}' 'http://consul-primary:8500/v1/connect/intentions/exact?source=${SOURCE}&destination=${DESTINATION}'"
}

function upsert_l4_intention {
Expand Down
2 changes: 0 additions & 2 deletions test/integration/connect/envoy/run-tests.windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,6 @@ function run_tests {
pre_service_setup alpha
fi

stop_and_copy_files

echo "Starting services"
start_services

Expand Down

0 comments on commit 45f272e

Please sign in to comment.