diff --git a/pkg/blobfuse-proxy/install-proxy-rhcos.sh b/pkg/blobfuse-proxy/install-proxy-rhcos.sh index 2b445de06..065147d2c 100644 --- a/pkg/blobfuse-proxy/install-proxy-rhcos.sh +++ b/pkg/blobfuse-proxy/install-proxy-rhcos.sh @@ -17,10 +17,25 @@ set -xe # in coreos, we could just copy the blobfuse2 binary to /usr/local/bin/blobfuse2 +updateBlobfuse2="true" if [ "${INSTALL_BLOBFUSE}" = "true" ] || [ "${INSTALL_BLOBFUSE2}" = "true" ] then + if [ -f "/host/usr/local/bin/blobfuse2" ];then + old=$(sha256sum /host/usr/local/bin/blobfuse2 | awk '{print $1}') + new=$(sha256sum /usr/bin/blobfuse2 | awk '{print $1}') + if [ "$old" = "$new" ];then + updateBlobfuse2="false" + echo "no need to update blobfuse2 since no change" + fi + fi +else + echo "no need to install blobfuse2" + updateBlobfuse2="false" +fi +if [ "$updateBlobfuse2" = "true" ];then echo "copy blobfuse2...." - cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2 + cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2 --force + chmod 755 /host/usr/local/bin/blobfuse2 fi # install blobfuse-proxy @@ -36,8 +51,7 @@ fi if [ "$updateBlobfuseProxy" = "true" ];then echo "copy blobfuse-proxy...." rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock - rm -rf /host/usr/local/bin/blobfuse-proxy - cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy + cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy --force chmod 755 /host/usr/local/bin/blobfuse-proxy fi diff --git a/pkg/blobfuse-proxy/install-proxy.sh b/pkg/blobfuse-proxy/install-proxy.sh index 422109179..d82b6eecd 100644 --- a/pkg/blobfuse-proxy/install-proxy.sh +++ b/pkg/blobfuse-proxy/install-proxy.sh @@ -90,8 +90,7 @@ fi if [ "$updateBlobfuseProxy" = "true" ];then echo "copy blobfuse-proxy...." rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock - rm -rf /host/usr/bin/blobfuse-proxy - cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy + cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy --force chmod 755 /host/usr/bin/blobfuse-proxy fi