Skip to content

Commit

Permalink
Merge pull request #4293 from ty-dc/fix/install-openxx
Browse files Browse the repository at this point in the history
fix: after the installation of openvswitch failed, retrying did not work.
Signed-off-by: robot <[email protected]>
  • Loading branch information
weizhoublue authored and ty-dc committed Nov 27, 2024
1 parent 0044fe0 commit 5ee9d59
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions test/scripts/install-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,24 @@ for NODE in $KIND_NODES; do
install_openvswitch() {
for attempt in {1..5}; do
echo "Attempt $attempt to install openvswitch on ${NODE}..."
docker exec ${NODE} apt-get update > /dev/null
docker exec ${NODE} apt-get install -y apt-utils > /dev/null
docker exec ${NODE} apt-get install -y openvswitch-switch > /dev/null
if ! docker exec ${NODE} apt-get update > /dev/null; then
echo "Failed to update package list on ${NODE}, retrying in 10s..."
sleep 10
continue
fi

if [[ $? -eq 0 ]]; then
echo "Openvswitch installed successfully on ${NODE}"
return 0
if ! docker exec ${NODE} apt-get install -y openvswitch-switch > /dev/null; then
echo "Failed to install openvswitch on ${NODE}, retrying in 10s..."
sleep 10
continue
fi

echo "Failed to install openvswitch on ${NODE}, retrying in 10s..."
sleep 10
echo "Succeed to install openvswitch on ${NODE}"
return 0
done
echo "Error: Failed to install openvswitch on ${NODE} after 5 attempts"
exit 1

echo "Error: Failed to install openvswitch on ${NODE} after 5 attempts." >&2
return 1
}

echo "=========install openvswitch"
Expand Down

0 comments on commit 5ee9d59

Please sign in to comment.