chore(helm): Waiting for postgres to be up
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
parent
7a95e071b3
commit
22d1177eef
1 changed files with 21 additions and 0 deletions
|
|
@ -63,6 +63,27 @@ spec:
|
||||||
git checkout {{ default .Chart.AppVersion .Values.dbMigrationUpstreamBranch }} || exit 10
|
git checkout {{ default .Chart.AppVersion .Values.dbMigrationUpstreamBranch }} || exit 10
|
||||||
{{ .Values.global.dbMigrationPreCommand | default "" }}
|
{{ .Values.global.dbMigrationPreCommand | default "" }}
|
||||||
|
|
||||||
|
exit_count=0
|
||||||
|
error_connection=1
|
||||||
|
|
||||||
|
while [ $exit_count -le 20 ];do
|
||||||
|
nc -zv {{.Values.global.postgresql.postgresqlHost}} {{.Values.global.postgresql.postgresqlPort}} -w 1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "[info] postgresql is not up; retrying in 5 seconds"
|
||||||
|
sleep 4
|
||||||
|
exit_count=$(($exit_count+1))
|
||||||
|
echo $exit_count
|
||||||
|
else
|
||||||
|
error_connection=0
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $error_connection -eq 1 ]; then
|
||||||
|
echo "[error] clickhouse is not running. Check kubectl get po -n db; exiting"
|
||||||
|
exit 100
|
||||||
|
fi
|
||||||
|
|
||||||
# Checking variable is empty. Shell independant method.
|
# Checking variable is empty. Shell independant method.
|
||||||
if [ "x$ENTERPRISE_EDITION_LICENSE" != "x" ]; then
|
if [ "x$ENTERPRISE_EDITION_LICENSE" != "x" ]; then
|
||||||
exit_count=0
|
exit_count=0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue