Skip to content

Commit ef3d918

Browse files
authored
Merge pull request #1448 from cvvz/release-1.23-1425
[release-1.23] fix: force copy blobfuse2 binary to avoid Text file busy error
2 parents 8fe2206 + 2809d88 commit ef3d918

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

pkg/blobfuse-proxy/install-proxy-rhcos.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,25 @@
1717
set -xe
1818

1919
# in coreos, we could just copy the blobfuse2 binary to /usr/local/bin/blobfuse2
20+
updateBlobfuse2="true"
2021
if [ "${INSTALL_BLOBFUSE}" = "true" ] || [ "${INSTALL_BLOBFUSE2}" = "true" ]
2122
then
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
2439
fi
2540

2641
# install blobfuse-proxy
@@ -36,8 +51,7 @@ fi
3651
if [ "$updateBlobfuseProxy" = "true" ];then
3752
echo "copy blobfuse-proxy...."
3853
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
54+
cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy --force
4155
chmod 755 /host/usr/local/bin/blobfuse-proxy
4256
fi
4357

pkg/blobfuse-proxy/install-proxy.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ fi
9090
if [ "$updateBlobfuseProxy" = "true" ];then
9191
echo "copy blobfuse-proxy...."
9292
rm -rf /host/var/lib/kubelet/plugins/blob.csi.azure.com/blobfuse-proxy.sock
93-
rm -rf /host/usr/bin/blobfuse-proxy
94-
cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy
93+
cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy --force
9594
chmod 755 /host/usr/bin/blobfuse-proxy
9695
fi
9796

0 commit comments

Comments
 (0)