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

macOS binaries do not have -amd64 or other arch suffix (yet) #6

Open
sudo6si opened this issue Nov 19, 2020 · 0 comments
Open

macOS binaries do not have -amd64 or other arch suffix (yet) #6

sudo6si opened this issue Nov 19, 2020 · 0 comments

Comments

@sudo6si
Copy link

sudo6si commented Nov 19, 2020

As of Nov 2020 installation of istio-v1.{7,8}.x or asdf install istioctl latest fails because the generated download link is invalid.

You are greeted with following error (because curl -L $download_url yields a Not Found string):

$ asdf install istioctl latest --verbose
Downloading istioctl from https://github.com/istio/istio/releases/download/1.7.4/istio-1.7.4-osx-amd64.tar.gz
bin_install_path: /Users/wadkar/.asdf/installs/istioctl/1.7.4/bin
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     9    0     0      6      0  0:00:01  0:00:01 --:--:--     6
tar: Error opening archive: Unrecognized archive format

Following patch works on macOS:

M bin/install
@@ -60,13 +60,17 @@ verlt() {
 }
 
 get_arch() {
-  verlt "$1" 1.6.0 && echo "" || echo "-amd64"
+  if [ "$2" = osx ]; then
+    echo ""
+  else
+    verlt "$1" 1.6.0 && echo "" || echo "-amd64"
+  fi
 }
 
 get_download_url() {
   local version="$1"
   local os_dist="$(get_platform)"
-  local arch="$(get_arch $version)"
+  local arch="$(get_arch "$version" "$os_dist")"
   echo "https://github.com/istio/istio/releases/download/${version}/istio-${version}-${os_dist}${arch}.tar.gz"
 }
 

Of course, feel free to flex your shell-foo and shorten the if conditional to your liking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant