From d24602af52031b5df4b7d9e03c6f3770358bf2b7 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 5 Jun 2023 09:37:21 -0400 Subject: [PATCH] Use $hostname in vtadmin script as other scripts do Signed-off-by: Matt Lord --- examples/common/scripts/vtadmin-up.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/common/scripts/vtadmin-up.sh b/examples/common/scripts/vtadmin-up.sh index c387b23c794..387ba439fb0 100755 --- a/examples/common/scripts/vtadmin-up.sh +++ b/examples/common/scripts/vtadmin-up.sh @@ -11,8 +11,8 @@ vtadmin_api_port=14200 vtadmin_web_port=14201 vtadmin \ - --addr ":${vtadmin_api_port}" \ - --http-origin "http://localhost:${vtadmin_web_port}" \ + --addr "${hostname}:${vtadmin_api_port}" \ + --http-origin "http://${hostname}:${vtadmin_web_port}" \ --http-tablet-url-tmpl "http://{{ .Tablet.Hostname }}:15{{ .Tablet.Alias.Uid }}" \ --tracer "opentracing-jaeger" \ --grpc-tracing \ @@ -29,7 +29,7 @@ echo ${vtadmin_api_pid} > "${log_dir}/vtadmin-api.pid" echo "\ vtadmin-api is running! - - API: http://localhost:${vtadmin_api_port} + - API: http://${hostname}:${vtadmin_api_port} - Logs: ${log_dir}/vtadmin-api.out - PID: ${vtadmin_api_pid} " @@ -37,7 +37,7 @@ vtadmin-api is running! # Wait for vtadmin to successfully discover the cluster expected_cluster_result="{\"result\":{\"clusters\":[{\"id\":\"${cluster_name}\",\"name\":\"${cluster_name}\"}]},\"ok\":true}" for _ in {0..300}; do - result=$(curl -s "http://localhost:${vtadmin_api_port}/api/clusters") + result=$(curl -s "http://${hostname}:${vtadmin_api_port}/api/clusters") if [[ ${result} == "${expected_cluster_result}" ]]; then break fi @@ -45,7 +45,7 @@ for _ in {0..300}; do done # Check one last time -[[ $(curl -s "http://localhost:${vtadmin_api_port}/api/clusters") == "${expected_cluster_result}" ]] || fail "vtadmin failed to discover the running example Vitess cluster." +[[ $(curl -s "http://${hostname}:${vtadmin_api_port}/api/clusters") == "${expected_cluster_result}" ]] || fail "vtadmin failed to discover the running example Vitess cluster." # Download nvm and node if [[ -z ${NVM_DIR} ]]; then @@ -74,7 +74,7 @@ nvm install "$NODE_VERSION" || fail "Could not install and use nvm $NODE_VERSION # other Vitess components.) npm --prefix "$web_dir" --silent install -VITE_VTADMIN_API_ADDRESS="http://localhost:${vtadmin_api_port}" \ +VITE_VTADMIN_API_ADDRESS="http://${hostname}:${vtadmin_api_port}" \ VITE_ENABLE_EXPERIMENTAL_TABLET_DEBUG_VARS="true" \ npm run --prefix "$web_dir" build @@ -86,7 +86,7 @@ echo ${vtadmin_web_pid} > "${log_dir}/vtadmin-web.pid" echo "\ vtadmin-web is running! - - Browser: http://localhost:${vtadmin_web_port} + - Browser: http://${hostname}:${vtadmin_web_port} - Logs: ${log_dir}/vtadmin-web.out - PID: ${vtadmin_web_pid} "