Fix naming conflict and redo formatting

This commit is contained in:
Sergey Dudoladov 2018-01-30 12:24:35 +01:00
parent 105bbdb8e4
commit f1bcdd1a8e
1 changed files with 70 additions and 73 deletions

View File

@ -21,15 +21,15 @@ readonly OPERATOR_PORT="8080"
# so the script retries actions until all the resources become available
function retry(){
# errexit may break "eval $cmd", so we disable it temporarily
# errexit may break "eval $retry_cmd", so we disable it temporarily
set +o errexit
local -r cmd="$1"
local -r retry_cmd="$1"
local -r retry_msg="$2"
# times out after 1 minute
for i in {1..20}; do
if eval "$cmd"; then
if eval "$retry_cmd"; then
set -o errexit # enable again
return 0
fi
@ -37,7 +37,7 @@ function retry(){
sleep 3
done
>2& echo "The command $cmd timed out"
>2& echo "The command $retry_cmd timed out"
return 1
}
@ -188,16 +188,14 @@ function check_health(){
echo "To stop it cleanly, run 'minikube delete'"
else
>2& echo "==== FAILURE: OPERATOR DID NOT START OR PORT FORWARDING DID NOT WORK"
>2& echo "This *might* have left the minikube VM image in inconsistent state."
exit 1
fi
}
function main(){
if ! [[ $(basename $PWD) == "postgres-operator" ]]; then
if ! [[ $(basename "$PWD") == "postgres-operator" ]]; then
echo "Please execute the script only from the root directory of the Postgres opepator repo."
exit 1
fi
@ -233,4 +231,3 @@ function main(){
main "$@"