Skip to content

Commit c152149

Browse files
authored
Merge pull request #604 from jingxu97/sep/prowimage
Use a fixed version of kustomization
2 parents c949b4f + e698112 commit c152149

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

deploy/kubernetes/install-kustomize.sh

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,50 @@ fi
1616
if [ -f "kustomize" ]; then
1717
rm kustomize
1818
fi
19-
echo "installing latest version of kustomize"
20-
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
19+
20+
echo "installing kustomize"
21+
22+
where=$PWD
23+
if [ -f $where/kustomize ]; then
24+
echo "A file named kustomize already exists (remove it first)."
25+
exit 1
26+
fi
27+
28+
tmpDir=`mktemp -d`
29+
if [[ ! "$tmpDir" || ! -d "$tmpDir" ]]; then
30+
echo "Could not create temp dir."
31+
exit 1
32+
fi
33+
34+
function cleanup {
35+
rm -rf "$tmpDir"
36+
}
37+
38+
trap cleanup EXIT
39+
40+
pushd $tmpDir >& /dev/null
41+
42+
opsys=windows
43+
if [[ "$OSTYPE" == linux* ]]; then
44+
opsys=linux
45+
elif [[ "$OSTYPE" == darwin* ]]; then
46+
opsys=darwin
47+
fi
48+
49+
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases |\
50+
grep browser_download |\
51+
grep $opsys |\
52+
cut -d '"' -f 4 |\
53+
grep /kustomize/v3.8.0 |\
54+
sort | tail -n 1 |\
55+
xargs curl -s -O -L
56+
57+
tar xzf ./kustomize_v*_${opsys}_amd64.tar.gz
58+
59+
cp ./kustomize $where
60+
61+
popd >& /dev/null
62+
63+
./kustomize version
64+
2165
mv kustomize "${INSTALL_DIR}"

0 commit comments

Comments
 (0)