File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,26 @@ set -o errexit
9
9
10
10
readonly INSTALL_DIR=" ${GOPATH} /src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/bin"
11
11
readonly KUSTOMIZE_PATH=" ${INSTALL_DIR} /kustomize"
12
+ readonly KUSTOMIZE_VERSION=" 2.0.3"
13
+ readonly VERSION_REGEX=" KustomizeVersion:([0-9]\.[0-9]\.[0-9])"
14
+
15
+ if [ -f " ${KUSTOMIZE_PATH} " ]; then
16
+ if [[ $( ${KUSTOMIZE_PATH} version) =~ ${VERSION_REGEX} ]]; then
17
+ if [ " ${KUSTOMIZE_VERSION} " != " ${BASH_REMATCH[1]} " ]; then
18
+ echo " Existing Kustomize version in ${KUSTOMIZE_PATH} v${BASH_REMATCH[1]} , need v${KUSTOMIZE_VERSION} . Removing existing binary."
19
+ rm " ${KUSTOMIZE_PATH} "
20
+ fi
21
+ fi
22
+ fi
12
23
13
24
if [ ! -f " ${KUSTOMIZE_PATH} " ]; then
14
25
if [ ! -f " ${INSTALL_DIR} " ]; then
15
26
mkdir -p ${INSTALL_DIR}
16
27
fi
17
28
18
- echo " Installing kustomize in ${KUSTOMIZE_PATH} "
29
+ echo " Installing Kustomize v ${KUSTOMIZE_VERSION} in ${KUSTOMIZE_PATH} "
19
30
opsys=linux # or darwin, or windows
20
- curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases/tags/v2.0.3 | \
31
+ curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases/tags/v ${KUSTOMIZE_VERSION} | \
21
32
grep browser_download | \
22
33
grep $opsys | \
23
34
cut -d ' "' -f 4 | \
You can’t perform that action at this time.
0 commit comments