From 3aae55e7f649836c070487b278ac34b1bd100d7d Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Fri, 18 Jan 2019 12:04:16 -0800 Subject: [PATCH] data/bootstrap: retry when reporting progress Previously, report-progress.sh relied on systemd to perform its retry logic. Unfortunately, this causes the logs to fill up with entries like the following: systemd[1]: progress.service holdoff time over, scheduling restart. systemd[1]: Stopped Report the completion of the cluster bootstrap process. systemd[1]: Starting Report the completion of the cluster bootstrap process... systemd[1]: Stopped Report the completion of the cluster bootstrap systemd[1]: progress.service: control process exited, code=exited status=1 systemd[1]: Failed to start Report the completion of the cluster bootstrap process. systemd[1]: Unit progress.service entered failed state. systemd[1]: progress.service failed. By adding the retry logic to report-progress.sh, these verbose logs are avoided. --- .../files/usr/local/bin/report-progress.sh | 48 ++++++++++++------- .../bootstrap/systemd/units/progress.service | 3 -- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/data/data/bootstrap/files/usr/local/bin/report-progress.sh b/data/data/bootstrap/files/usr/local/bin/report-progress.sh index 58d9a966420..d3245c31c4e 100755 --- a/data/data/bootstrap/files/usr/local/bin/report-progress.sh +++ b/data/data/bootstrap/files/usr/local/bin/report-progress.sh @@ -1,26 +1,38 @@ #!/usr/bin/env bash -set -e KUBECONFIG="${1}" NAME="${2}" MESSAGE="${3}" -TIMESTAMP="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -echo "Reporting install progress..." +wait_for_existance() { + while [ ! -e "${1}" ] + do + sleep 5 + done +} + +echo "Waiting for bootstrap to complete..." +wait_for_existance /opt/openshift/.bootkube.done +wait_for_existance /opt/openshift/.openshift.done -oc --config="$KUBECONFIG" create -f - <