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

fix: after the installation of openvswitch failed, retrying did not work. #4326

Merged
merged 1 commit into from
Nov 27, 2024
Merged
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
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
Loading