Skip to content
2 changes: 1 addition & 1 deletion keystone/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
repository: monasca/keystone
variants:
- tag: 1.1.2
- tag: 1.1.3
aliases:
- :latest
9 changes: 3 additions & 6 deletions keystone/keystone-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ fi

if [[ "$KUBERNETES_RESOLVE_PUBLIC_ENDPOINTS" = "true" ]]; then
keystone_service_name=${KEYSTONE_SERVICE_NAME:-"keystone"}
service_url=$(python /k8s_get_service.py "${keystone_service_name}" http)
if [[ $? -eq 0 ]]; then
if service_url=$(python /k8s_get_service.py "${keystone_service_name}" http); then
public_url="http://${service_url}"
else
echo "ERROR: Failed to get public URL from Kubernetes API!"
fi

service_admin_url=$(python /k8s_get_service.py "${keystone_service_name}" admin)
if [[ $? -eq 0 ]]; then
if service_admin_url=$(python /k8s_get_service.py "${keystone_service_name}" admin); then
admin_url="http://${service_admin_url}"
else
# not ERROR since this is somewhat less fatal
Expand All @@ -56,8 +54,7 @@ if [[ -e /db-init ]]; then
echo "Waiting for keystone to become available at $admin_url..."
success=false
for i in {1..10}; do
curl -sSf "$admin_url" > /dev/null
if [[ $? -eq 0 ]]; then
if curl -sSf "$admin_url" > /dev/null; then
echo "Keystone API is up, continuing..."
success=true
break
Expand Down
9 changes: 4 additions & 5 deletions keystone/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ if [[ "$KEYSTONE_DATABASE_BACKEND" = "mysql" ]]; then
echo "Waiting for mysql to become available..."
success="false"
for i in $(seq "$retries"); do
mysqladmin status \
if mysqladmin status \
--host="$mysql_host" \
--user="$mysql_user" \
--password="$mysql_pass" \
--connect_timeout=10
if [[ $? -eq 0 ]]; then
--connect_timeout=10; then
echo "MySQL is available, continuing..."
success="true"
break
Expand All @@ -40,8 +39,8 @@ if [[ "$KEYSTONE_DATABASE_BACKEND" = "mysql" ]]; then
/etc/keystone/keystone.conf

# check to see if table exists already and skip init if so
mysql -h "${mysql_host}" -u "${mysql_user}" -p"${mysql_pass}" -e "desc ${mysql_db}.migrate_version" &> /dev/null
if [[ $? -eq 0 ]]; then
if mysql -h "${mysql_host}" -u "${mysql_user}" -p"${mysql_pass}" \
-e "desc ${mysql_db}.migrate_version" &> /dev/null; then
echo "MySQL database has already been initialized, skipping..."
else
echo "Syncing keystone database to MySQL..."
Expand Down
3 changes: 2 additions & 1 deletion kibana/wait-for.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ wait_for_wrapper()
timeout "$BUSYTIMEFLAG" "$TIMEOUT" "$0" --child --host="$HOST" --port="$PORT" --timeout="$TIMEOUT" &
fi
PID=$!
# shellcheck disable=SC2064
trap "kill -INT -$PID" INT
wait $PID
RESULT=$?
Expand Down Expand Up @@ -118,7 +119,7 @@ do
;;
--)
shift
CLI="$@"
CLI="$*"
break
;;
--help)
Expand Down