Skip to content

Commit 16d3f21

Browse files
authored
Merge pull request #744 from mattcary/kustomize
Improve kustomize downloading
2 parents 3aa5fea + 89bf24e commit 16d3f21

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Diff for: deploy/kubernetes/install-kustomize.sh

+12-7
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,26 @@ trap cleanup EXIT
4040
pushd $tmpDir >& /dev/null
4141

4242
opsys=windows
43+
arch=amd64
4344
if [[ "$OSTYPE" == linux* ]]; then
44-
opsys=linux_amd64
45+
opsys=linux
4546
elif [[ "$OSTYPE" == darwin* ]]; then
4647
opsys=darwin
4748
fi
4849

49-
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases |\
50-
grep browser_download |\
51-
grep $opsys |\
50+
# As github has a limit on what stored in releases/, and kustomize has many different package
51+
# versions, we just point directly at the version we want. See
52+
# github.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh.
53+
54+
version=v3.9.4
55+
url_base=https://api.github.com/repos/kubernetes-sigs/kustomize/releases/tags/kustomize%2F
56+
curl -s ${url_base}${version} |\
57+
grep browser_download.*${opsys}_${arch} |\
5258
cut -d '"' -f 4 |\
53-
grep /kustomize/v3.9.4 |\
54-
sort | tail -n 1 |\
59+
sort -V | tail -n 1 |\
5560
xargs curl -s -O -L
5661

57-
tar xzf ./kustomize_v*_${opsys}.tar.gz
62+
tar xzf ./kustomize_v*_${opsys}_${arch}.tar.gz
5863

5964
cp ./kustomize $where
6065

0 commit comments

Comments
 (0)