Skip to content

Commit bf3b86a

Browse files
cvvzk8s-infra-cherrypick-robot
authored andcommitted
fix: force copy blobfuse2 binary to avoid Text file busy error
1 parent a29f56c commit bf3b86a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ set -xe
2020
if [ "${INSTALL_BLOBFUSE}" = "true" ] || [ "${INSTALL_BLOBFUSE2}" = "true" ]
2121
then
2222
echo "copy blobfuse2...."
23-
cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2
23+
old=$(sha256sum /host/usr/local/bin/blobfuse2 | awk '{print $1}')
24+
new=$(sha256sum /usr/bin/blobfuse2 | awk '{print $1}')
25+
if [ "$old" != "$new" ];then
26+
cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2 --force
27+
fi
2428
fi
2529

2630
# install blobfuse-proxy
@@ -36,8 +40,7 @@ fi
3640
if [ "$updateBlobfuseProxy" = "true" ];then
3741
echo "copy blobfuse-proxy...."
3842
rm -rf /host/"$KUBELET_PATH"/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
43+
cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy --force
4144
chmod 755 /host/usr/local/bin/blobfuse-proxy
4245
fi
4346

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/"$KUBELET_PATH"/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)