Skip to content

Commit

Permalink
feat(enable-arm64-compatibility): add a more generic get_platform fun…
Browse files Browse the repository at this point in the history
…ction in install script
  • Loading branch information
RemiPoux committed Nov 4, 2022
1 parent 349dfa1 commit 3446818
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,27 @@
set -e
set -o pipefail

get_arch() {
local arch=""

case "$(uname -m)" in
x86_64 | amd64) arch="amd64" ;;
i686 | i386) arch="386" ;;
aarch64 | arm64) arch="arm64" ;;
*)
fail "Arch '$(uname -m)' not supported!"
;;
esac

echo -n $arch
}

install() {
version=$2
install_path=$3
bin_path=${install_path}/bin/kind
platform=$(uname | tr [:upper:] [:lower:])
arch=amd64
arch=$(get_arch)
filename=kind-${platform}-${arch}
github_base_url=https://github.com/kubernetes-sigs/kind/releases/download
download_url="${github_base_url}/v${version}/${filename}"
Expand Down

0 comments on commit 3446818

Please sign in to comment.