Skip to content

Commit 598fa13

Browse files
andyzhangxk8s-infra-cherrypick-robot
authored andcommitted
fix: install proxy failure on some distros
fix fix
1 parent 205bb06 commit 598fa13

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pkg/azurefile-proxy/install-proxy.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,12 @@ if [ "${INSTALL_AZUREFILE_PROXY}" = "true" ];then
6868
fi
6969
if [ "$updateAzurefileProxy" = "true" ];then
7070
echo "copy azurefile-proxy...."
71+
# if it reports "Read-only file system" error here, return as success
72+
if ! cp /azurefile-proxy/azurefile-proxy /host/usr/bin/azurefile-proxy --force; then
73+
echo "Warning: failed to copy azurefile-proxy, possibly due to read-only file system, continue..."
74+
exit 0
75+
fi
7176
rm -rf /host/"$KUBELET_PATH"/plugins/file.csi.azure.com/azurefile-proxy.sock
72-
cp /azurefile-proxy/azurefile-proxy /host/usr/bin/azurefile-proxy --force
7377
chmod 755 /host/usr/bin/azurefile-proxy
7478
fi
7579

@@ -85,7 +89,12 @@ if [ "${INSTALL_AZUREFILE_PROXY}" = "true" ];then
8589
if [ "$updateService" = "true" ];then
8690
echo "copy azurefile-proxy.service...."
8791
mkdir -p /host/usr/lib/systemd/system
88-
cp /azurefile-proxy/azurefile-proxy.service /host/usr/lib/systemd/system/azurefile-proxy.service
92+
93+
# if it reports "Read-only file system" error here, return as success
94+
if ! cp /azurefile-proxy/azurefile-proxy.service /host/usr/lib/systemd/system/azurefile-proxy.service; then
95+
echo "Warning: failed to copy azurefile-proxy.service, possibly due to read-only file system, continue..."
96+
exit 0
97+
fi
8998
fi
9099

91100
$HOST_CMD systemctl daemon-reload

0 commit comments

Comments
 (0)