Merge "[COMMON] Fix declare bashisms"
authorFiachra Corcoran <fiachra.corcoran@est.tech>
Thu, 28 Apr 2022 14:42:22 +0000 (14:42 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 28 Apr 2022 14:42:22 +0000 (14:42 +0000)
1  2 
kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh

@@@ -1,6 -1,7 +1,6 @@@
  #!/bin/bash
  
  set -eo pipefail
 -shopt -s nullglob
  
  # logging functions
  mysql_log() {
@@@ -169,11 -170,20 +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' "$@")"
  
      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