1717set -xe
1818
1919# in coreos, we could just copy the blobfuse2 binary to /usr/local/bin/blobfuse2
20+ updateBlobfuse2=" true"
2021if [ " ${INSTALL_BLOBFUSE} " = " true" ] || [ " ${INSTALL_BLOBFUSE2} " = " true" ]
2122then
23+ if [ -f " /host/usr/local/bin/blobfuse2" ]; then
24+ old=$( sha256sum /host/usr/local/bin/blobfuse2 | awk ' {print $1}' )
25+ new=$( sha256sum /usr/bin/blobfuse2 | awk ' {print $1}' )
26+ if [ " $old " = " $new " ]; then
27+ updateBlobfuse2=" false"
28+ echo " no need to update blobfuse2 since no change"
29+ fi
30+ fi
31+ else
32+ echo " no need to install blobfuse2"
33+ updateBlobfuse2=" false"
34+ fi
35+ if [ " $updateBlobfuse2 " = " true" ]; then
2236 echo " copy blobfuse2...."
23- cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2
37+ cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2 --force
38+ chmod 755 /host/usr/local/bin/blobfuse2
2439fi
2540
2641# install blobfuse-proxy
@@ -35,9 +50,8 @@ if [ -f "/host/usr/local/bin/blobfuse-proxy" ];then
3550fi
3651if [ " $updateBlobfuseProxy " = " true" ]; then
3752 echo " copy blobfuse-proxy...."
38- rm -rf /host/var/lib/kubelet/plugins/blob.csi.azure.com/blobfuse-proxy.sock
39- rm -rf /host/usr/local/bin/blobfuse-proxy
40- cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy
53+ rm -rf /host/" $KUBELET_PATH " /plugins/blob.csi.azure.com/blobfuse-proxy.sock
54+ cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy --force
4155 chmod 755 /host/usr/local/bin/blobfuse-proxy
4256fi
4357
0 commit comments