diff options
author | Fiachra Corcoran <fiachra.corcoran@est.tech> | 2022-04-28 14:42:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-04-28 14:42:22 +0000 |
commit | 24f188ef01678376820221a26cafa0bfff719a13 (patch) | |
tree | e6298958b8729f2d63d7e5dc041910cfb44ffa60 /kubernetes | |
parent | 020e4a194188736b63327b6f74ea0777336883be (diff) | |
parent | b6ee0d3362c582811573198976e51c2ce21961dc (diff) |
Merge "[COMMON] Fix declare bashisms"
Diffstat (limited to 'kubernetes')
-rw-r--r-- | kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh b/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh index be4ec7c18a..63d266b75c 100644 --- a/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh +++ b/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh @@ -169,11 +169,20 @@ docker_init_database_dir() { mysql_note "Database files initialized" } +if [ -z "$DATADIR" ]; then + DATADIR='unknown' +fi +if [ -z "$SOCKET" ]; then + SOCKET='unknown' +fi +if [ -z "$DATABASE_ALREADY_EXISTS" ]; then + DATABASE_ALREADY_EXISTS='false' +fi + # Loads various settings that are used elsewhere in the script # This should be called after mysql_check_config, but before any other functions docker_setup_env() { # Get config - declare -g DATADIR SOCKET DATADIR="$(mysql_get_config 'datadir' "$@")" SOCKET="$(mysql_get_config 'socket' "$@")" @@ -185,7 +194,6 @@ docker_setup_env() { file_env 'MYSQL_ROOT_PASSWORD' file_env 'PORTAL_DB_TABLES' - declare -g DATABASE_ALREADY_EXISTS if [ -d "$DATADIR/mysql" ]; then DATABASE_ALREADY_EXISTS='true' fi |