Skip to content

Commit b0711a5

Browse files
committed
Use our ztunnel
Signed-off-by: Zuzana Miklankova <zmiklank@redhat.com>
1 parent ceabf3d commit b0711a5

File tree

3 files changed

+4
-44
lines changed

3 files changed

+4
-44
lines changed

bin/build_ztunnel.sh

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -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
12586
fi
@@ -133,5 +94,4 @@ ISTIO_ZTUNNEL_LINUX_DEBUG_DIR="${ISTIO_ZTUNNEL_LINUX_DEBUG_DIR:-${TARGET_OUT_LIN
13394
ISTIO_ZTUNNEL_LINUX_RELEASE_PATH="${ISTIO_ZTUNNEL_LINUX_RELEASE_PATH:-${ISTIO_ZTUNNEL_LINUX_RELEASE_DIR}/${ISTIO_ZTUNNEL_LINUX_RELEASE_NAME}}"
13495

13596
set_download_command
136-
maybe_build_ztunnel
13797
download_ztunnel_if_necessary "${ISTIO_ZTUNNEL_RELEASE_URL}" "$ISTIO_ZTUNNEL_LINUX_RELEASE_PATH" "ztunnel"

bin/update_ztunnel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cd "${ROOTDIR}"
2727
function getSha() {
2828
local dir result
2929
dir=$(mktemp -d)
30-
git clone --depth=1 "https://github.com/istio/${1}.git" -b "${UPDATE_BRANCH}" "${dir}"
30+
git clone --depth=1 "https://github.com/openshift-service-mesh/${1}.git" -b "${UPDATE_BRANCH}" "${dir}"
3131

3232
result="$(cd "${dir}" && git rev-parse HEAD)"
3333
rm -rf "${dir}"

istio.deps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"name": "ZTUNNEL_REPO_SHA",
1212
"repoName": "ztunnel",
1313
"file": "",
14-
"lastStableSHA": "055baef94d1d1ec90859196ce015ac0bba587503"
14+
"lastStableSHA": "f64fcbc3cf1cc47106187837bb9a6cf24e5e66b7"
1515
}
1616
]

0 commit comments

Comments
 (0)