From d2bf405cd0662477e46dd95e565db10066e7bd68 Mon Sep 17 00:00:00 2001 From: Leonard Goodell Date: Thu, 29 Sep 2022 09:46:07 -0700 Subject: [PATCH] fix: Always run "kong migrations up" This ensures any missing migration are run and doesn't hurt is there are none. Non need to run `kong migrations list` fixes #4171 Signed-off-by: Leonard Goodell --- .../entrypoint-scripts/kong_wait_install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/security-bootstrapper/entrypoint-scripts/kong_wait_install.sh b/cmd/security-bootstrapper/entrypoint-scripts/kong_wait_install.sh index 09c3587c29..850c9af9f3 100755 --- a/cmd/security-bootstrapper/entrypoint-scripts/kong_wait_install.sh +++ b/cmd/security-bootstrapper/entrypoint-scripts/kong_wait_install.sh @@ -69,16 +69,16 @@ export KONG_PG_PASSWORD_FILE # remove env KONG_PG_PASSWORD: only use KONG_PG_PASSWORD_FILE unset KONG_PG_PASSWORD +set +e /docker-entrypoint.sh kong migrations bootstrap -/docker-entrypoint.sh kong migrations list +/docker-entrypoint.sh kong migrations up +/docker-entrypoint.sh kong migrations finish code=$? -if [ $code -eq 0 ]; then - echo "$(date) kong migrations bootstrap ok, doing migrations up and finish..." - /docker-entrypoint.sh kong migrations up && /docker-entrypoint.sh kong migrations finish -else +if [ $code -ne 0 ]; then echo "$(date) failed to kong migrations, returned code = " $code + exit $code fi - +set -e echo "$(date) Configuring Kong Admin API..." # Running "kong config db_import" will return a non-successful error code even though it