@@ -76,50 +76,11 @@ function download_ztunnel_if_necessary () {
7676 cp -f " ${2} " " ${TARGET_OUT_LINUX} /ztunnel"
7777}
7878
79- function maybe_build_ztunnel() {
80- # TODO detect git changes or something to avoid unnecessarily building
81- # BUILD_ZTUNNEL=1 with no BUILD_ZTUNNEL_REPO tries to infer BUILD_ZTUNNEL_REPO
82- if [[ " ${BUILD_ZTUNNEL_REPO:- } " == " " ]] && [[ " ${BUILD_ZTUNNEL:- } " != " " ]]; then
83- local ZTUNNEL_DIR
84- ZTUNNEL_DIR=" $( pwd) /../ztunnel"
85- if [[ -d " ${ZTUNNEL_DIR} " ]]; then
86- BUILD_ZTUNNEL_REPO=" ${ZTUNNEL_DIR} "
87- else
88- echo " No directory at ${ZTUNNEL_DIR} "
89- return
90- fi
91- fi
92- if [[ " ${BUILD_ZTUNNEL_REPO:- } " == " " ]]; then
93- return
94- fi
95-
96- if ! which cargo; then
97- echo " the rust toolchain (cargo, etc) is required for building ztunnel"
98- return 1
99- fi
100-
101- pushd " ${BUILD_ZTUNNEL_REPO} "
102- cargo build --profile=" ${BUILD_ZTUNNEL_PROFILE:- dev} " ${BUILD_ZTUNNEL_TARGET: +--target=${BUILD_ZTUNNEL_TARGET} }
103-
104- local ZTUNNEL_BIN_PATH
105- if [[ " ${BUILD_ZTUNNEL_PROFILE:- dev} " == " dev" ]]; then
106- ZTUNNEL_BIN_PATH=debug
107- else
108- ZTUNNEL_BIN_PATH=" ${BUILD_ZTUNNEL_PROFILE} "
109- fi
110- ZTUNNEL_BIN_PATH=" out/rust/${BUILD_ZTUNNEL_TARGET: +${BUILD_ZTUNNEL_TARGET} / }${ZTUNNEL_BIN_PATH} /ztunnel"
111-
112- echo " Copying $( pwd) /${ZTUNNEL_BIN_PATH} to ${TARGET_OUT_LINUX} /ztunnel"
113- mkdir -p " ${TARGET_OUT_LINUX} "
114- cp " ${ZTUNNEL_BIN_PATH} " " ${TARGET_OUT_LINUX} /ztunnel"
115- popd
116- }
117-
11879# ztunnel binary vars (TODO handle debug builds, arm, darwin etc.)
119- ISTIO_ZTUNNEL_BASE_URL=" ${ISTIO_ZTUNNEL_BASE_URL:- https:// storage.googleapis.com/ istio-build / ztunnel} "
80+ ISTIO_ZTUNNEL_BASE_URL=" ${ISTIO_ZTUNNEL_BASE_URL:- https:// storage.googleapis.com/ maistra-prow-testing / ztunnel} "
12081
12182# If we are not using the default, assume its private and we need to authenticate
122- if [[ " ${ISTIO_ZTUNNEL_BASE_URL} " != " https://storage.googleapis.com/istio-build/ztunnel" ]]; then
83+ if [[ " ${ISTIO_ZTUNNEL_BASE_URL} " != " https://storage.googleapis.com/istio-build/ztunnel" && " ${ISTIO_ZTUNNEL_BASE_URL} " != " https://storage.googleapis.com/maistra-prow-testing/ztunnel " ]]; then
12384 AUTH_HEADER=" Authorization: Bearer $( gcloud auth print-access-token) "
12485 export AUTH_HEADER
12586fi
@@ -133,5 +94,4 @@ ISTIO_ZTUNNEL_LINUX_DEBUG_DIR="${ISTIO_ZTUNNEL_LINUX_DEBUG_DIR:-${TARGET_OUT_LIN
13394ISTIO_ZTUNNEL_LINUX_RELEASE_PATH=" ${ISTIO_ZTUNNEL_LINUX_RELEASE_PATH:- ${ISTIO_ZTUNNEL_LINUX_RELEASE_DIR} / ${ISTIO_ZTUNNEL_LINUX_RELEASE_NAME} } "
13495
13596set_download_command
136- maybe_build_ztunnel
13797download_ztunnel_if_necessary " ${ISTIO_ZTUNNEL_RELEASE_URL} " " $ISTIO_ZTUNNEL_LINUX_RELEASE_PATH " " ztunnel"
0 commit comments