Merge pull request #108 from mikebrow/wait-for-containerd
loop waiting for containerd server to respond to client connection
This commit is contained in:
commit
230f03a47d
@ -61,7 +61,16 @@ if [ ! -x "$(command -v containerd)" ]; then
|
|||||||
fi
|
fi
|
||||||
sudo pkill containerd
|
sudo pkill containerd
|
||||||
sudo containerd -l debug &> ${REPORT_DIR}/containerd.log &
|
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
|
# Start cri-containerd
|
||||||
cd ${ROOT}
|
cd ${ROOT}
|
||||||
|
Loading…
Reference in New Issue
Block a user