Skip to content

Commit

Permalink
Merge pull request #1086 from amazeeio/1048-fail-deployment-infiniteloop
Browse files Browse the repository at this point in the history
Added a configurable timeout to exit the loop
  • Loading branch information
Schnitzel authored May 28, 2019
2 parents 75c4caa + d502781 commit c074b9b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions images/oc-build-deploy-dind/build-deploy-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,19 @@ do

mariadb-shared)
# ServiceBrokers take a bit, wait until the credentials secret is available
# We added a timeout of 10 minutes (120 retries) before exit
SERVICE_BROKER_COUNTER=1
SERVICE_BROKER_TIMEOUT=180
until oc get --insecure-skip-tls-verify -n ${OPENSHIFT_PROJECT} secret ${SERVICE_NAME}-servicebroker-credentials
do
echo "Secret ${SERVICE_NAME}-servicebroker-credentials not available yet, waiting for 5 secs"
sleep 5
if [ $SERVICE_BROKER_COUNTER -lt $SERVICE_BROKER_TIMEOUT ]; then
let SERVICE_BROKER_COUNTER=SERVICE_BROKER_COUNTER+1
echo "Secret ${SERVICE_NAME}-servicebroker-credentials not available yet, waiting for 5 secs"
sleep 5
else
echo "Timeout of $SERVICE_BROKER_TIMEOUT for ${SERVICE_NAME}-servicebroker-credentials reached"
exit 1
fi
done
# Load credentials out of secret
oc get --insecure-skip-tls-verify -n ${OPENSHIFT_PROJECT} secret ${SERVICE_NAME}-servicebroker-credentials -o yaml > /oc-build-deploy/lagoon/${SERVICE_NAME}-servicebroker-credentials.yml
Expand Down

0 comments on commit c074b9b

Please sign in to comment.