loop waiting for containerd server to respond
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
This commit is contained in:
parent
a14153a218
commit
6a9152e83f
@ -61,7 +61,16 @@ if [ ! -x "$(command -v containerd)" ]; then
|
||||
fi
|
||||
sudo pkill containerd
|
||||
sudo containerd -l debug &> ${REPORT_DIR}/containerd.log &
|
||||
sleep 1 # sleep 1 seconds for containerd to be ready.
|
||||
|
||||
# Wait for containerd to be running by using the containerd client ctr to check the version
|
||||
# of the containerd server. Wait an increasing amount of time after each of five attempts
|
||||
MAX_ATTEMPTS=5
|
||||
attempt_num=1
|
||||
until sudo ctr version &> /dev/null || (( attempt_num == MAX_ATTEMPTS ))
|
||||
do
|
||||
echo "Attempt $attempt_num to connect to containerd failed! Trying again in $attempt_num seconds..."
|
||||
sleep $(( attempt_num++ ))
|
||||
done
|
||||
|
||||
# Start cri-containerd
|
||||
cd ${ROOT}
|
||||
|
Loading…
Reference in New Issue
Block a user