Skip to content

Commit

Permalink
Merge pull request #1444 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1425-to-release-1.24

[release-1.24] fix: force copy blobfuse2 binary to avoid Text file busy error
  • Loading branch information
k8s-ci-robot authored Jun 21, 2024
2 parents a29f56c + 5ad9534 commit 94a475d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
20 changes: 17 additions & 3 deletions pkg/blobfuse-proxy/install-proxy-rhcos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
3 changes: 1 addition & 2 deletions pkg/blobfuse-proxy/install-proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 94a475d

Please sign in to comment.