Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.24] fix: force copy blobfuse2 binary to avoid Text file busy error #1444

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading