Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed download url for istio 1.6 #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,65 @@ install_istioctl() {
rm -rf $PWD/istio-$version
}

get_arch() {
get_os() {
uname="$(uname -s)"
case "${uname}" in
Linux*) machine=linux;;
Darwin*) machine=osx;;
*) machine="UNKNOWN:${uname}"
esac

echo ${machine}
}

get_arch() {
local local_arch=$(uname -m)
local istio_arch=""

case "${local_arch}" in
x86_64)
istio_arch=amd64
;;
armv8*)
istio_arch=arm64
;;
aarch64*)
istio_arch=arm64
;;
armv*)
istio_arch=armv7
;;
amd64|arm64)
istio_arch=${local_arch}
;;
*)
echo "This system's architecture, ${local_arch}, isn't supported"
exit 1
;;
esac

echo ${istio_arch}
}

is_new_download_link() {
local version="$1"
local major="${version:0:1}"
local minor="${version:2:1}"
if [ "${major}" -ge 2 -o "${minor}" -ge 6 ]; then
echo 0
else
echo 1
fi
}

get_download_url() {
local version="$1"
local os_dist="$(get_arch)"
local os_dist="$(get_os)"
local is_new="$(is_new_download_link $version)"

if [ "${os_dist}" = "linux" -a "${is_new}" -eq 0 ]; then
os_dist="${os_dist}-$(get_arch)"
fi
echo "https://github.com/istio/istio/releases/download/${version}/istio-${version}-${os_dist}.tar.gz"
}

Expand Down