@@ -42,35 +42,77 @@ if [ "x${ISTIO_VERSION}" = "x" ] ; then
42
42
grep -v -E " (alpha|beta|rc)\.[0-9]$" | sort -t" ." -k 1,1 -k 2,2 -k 3,3 -k 4,4 | tail -n 1)
43
43
fi
44
44
45
+ LOCAL_ARCH=$( uname -m)
46
+ if [ " ${TARGET_ARCH} " ]; then
47
+ LOCAL_ARCH=${TARGET_ARCH}
48
+ fi
49
+
50
+ case " ${LOCAL_ARCH} " in
51
+ x86_64)
52
+ ISTIO_ARCH=amd64
53
+ ;;
54
+ armv8* )
55
+ ISTIO_ARCH=arm64
56
+ ;;
57
+ aarch64* )
58
+ ISTIO_ARCH=arm64
59
+ ;;
60
+ armv* )
61
+ ISTIO_ARCH=armv7
62
+ ;;
63
+ amd64|arm64)
64
+ ISTIO_ARCH=${LOCAL_ARCH}
65
+ ;;
66
+ * )
67
+ echo " This system's architecture, ${LOCAL_ARCH} , isn't supported"
68
+ exit 1
69
+ ;;
70
+ esac
71
+
45
72
if [ " x${ISTIO_VERSION} " = " x" ] ; then
46
73
printf " Unable to get latest Istio version. Set ISTIO_VERSION env var and re-run. For example: export ISTIO_VERSION=1.0.4"
47
74
exit ;
48
75
fi
49
76
50
77
NAME=" istio-$ISTIO_VERSION "
51
78
URL=" https://github.com/istio/istio/releases/download/${ISTIO_VERSION} /istio-${ISTIO_VERSION} -${OSEXT} .tar.gz"
79
+ ARCH_URL=" https://github.com/istio/istio/releases/download/${ISTIO_VERSION} /istio-${ISTIO_VERSION} -${OSEXT} -${ISTIO_ARCH} .tar.gz"
80
+
52
81
printf " Downloading %s from %s ..." " $NAME " " $URL "
53
- if ! curl -L " $URL " | tar xz
82
+ if ! curl -fsLO " $URL "
54
83
then
55
- printf " \n\n"
56
- printf " Unable to download Istio %s at this moment!\n" " $ISTIO_VERSION "
57
- printf " Please verify the version you are trying to download.\n\n"
84
+ printf " Failed.\n\nTrying with TARGET_ARCH. Downloading %s from %s ...\n" " $NAME " " $ARCH_URL "
85
+ if ! curl -fsLO " $ARCH_URL "
86
+ then
87
+ printf " \n\n"
88
+ printf " Unable to download Istio %s at this moment!\n" " $ISTIO_VERSION "
89
+ printf " Please verify the version you are trying to download.\n\n"
90
+ exit
91
+ else
92
+ filename=" istio-${ISTIO_VERSION} -${OSEXT} -${ISTIO_ARCH} .tar.gz"
93
+ tar -xzf " ${filename} "
94
+ rm " ${filename} "
95
+ fi
58
96
else
59
- printf " "
60
- printf " Istio %s Download Complete!\n" " $ISTIO_VERSION "
61
- printf " \n"
62
- printf " Istio has been successfully downloaded into the %s folder on your system.\n" " $NAME "
63
- printf " \n"
64
- BINDIR=" $( cd " $NAME /bin" && pwd) "
65
- printf " Next Steps:\n"
66
- printf " See https://istio.io/docs/setup/kubernetes/install/ to add Istio to your Kubernetes cluster.\n"
67
- printf " \n"
68
- printf " To configure the istioctl client tool for your workstation,\n"
69
- printf " add the %s directory to your environment path variable with:\n" " $BINDIR "
70
- printf " \t export PATH=\"\$ PATH:%s\" \n" " $BINDIR "
71
- printf " \n"
72
- printf " Begin the Istio pre-installation verification check by running:\n"
73
- printf " \t istioctl verify-install \n"
74
- printf " \n"
75
- printf " Need more information? Visit https://istio.io/docs/setup/kubernetes/install/ \n"
97
+ filename=" istio-${ISTIO_VERSION} -${OSEXT} .tar.gz"
98
+ tar -xzf " ${filename} "
99
+ rm " ${filename} "
76
100
fi
101
+
102
+ printf " "
103
+ printf " \nIstio %s Download Complete!\n" " $ISTIO_VERSION "
104
+ printf " \n"
105
+ printf " Istio has been successfully downloaded into the %s folder on your system.\n" " $NAME "
106
+ printf " \n"
107
+ BINDIR=" $( cd " $NAME /bin" && pwd) "
108
+ printf " Next Steps:\n"
109
+ printf " See https://istio.io/docs/setup/kubernetes/install/ to add Istio to your Kubernetes cluster.\n"
110
+ printf " \n"
111
+ printf " To configure the istioctl client tool for your workstation,\n"
112
+ printf " add the %s directory to your environment path variable with:\n" " $BINDIR "
113
+ printf " \t export PATH=\"\$ PATH:%s\" \n" " $BINDIR "
114
+ printf " \n"
115
+ printf " Begin the Istio pre-installation verification check by running:\n"
116
+ printf " \t istioctl verify-install \n"
117
+ printf " \n"
118
+ printf " Need more information? Visit https://istio.io/docs/setup/kubernetes/install/ \n"
0 commit comments