diff --git a/keystone/build.yml b/keystone/build.yml index 15040542d..3bbee21c6 100644 --- a/keystone/build.yml +++ b/keystone/build.yml @@ -1,5 +1,5 @@ repository: monasca/keystone variants: - - tag: 1.1.2 + - tag: 1.1.3 aliases: - :latest diff --git a/keystone/keystone-bootstrap.sh b/keystone/keystone-bootstrap.sh index 5802a5397..9623856e1 100755 --- a/keystone/keystone-bootstrap.sh +++ b/keystone/keystone-bootstrap.sh @@ -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 @@ -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 diff --git a/keystone/start.sh b/keystone/start.sh index f3d0e68fc..24e530ca2 100755 --- a/keystone/start.sh +++ b/keystone/start.sh @@ -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 @@ -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..." diff --git a/kibana/wait-for.sh b/kibana/wait-for.sh index 337119666..e96a50c1f 100644 --- a/kibana/wait-for.sh +++ b/kibana/wait-for.sh @@ -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=$? @@ -118,7 +119,7 @@ do ;; --) shift - CLI="$@" + CLI="$*" break ;; --help)