-
Bug
-
Resolution: Done
-
Normal
-
rhos-18.0.z
-
None
-
1
-
False
-
-
False
-
?
-
rhos-ops-day1day2-upgrades
-
None
-
-
-
-
RHOS Upgrades 2025 Sprint 12
-
1
-
Important
PASSWORD_FILE="$HOME/overcloud-passwords.yaml" MARIADB_IMAGE=registry.redhat.io/rhoso/openstack-mariadb-rhel9:18.0 declare -A TRIPLEO_PASSWORDS CELLS="default" for CELL in $(echo $CELLS); do oc get secret tripleo-passwords -o json | jq -r '.data["tripleo-overcloud-passwords.yaml"]' | base64 -d >"$TRIPLEO_PASSWORDS[$CELL]" done declare -A SOURCE_DB_ROOT_PASSWORD for CELL in $(echo $CELLS); do SOURCE_DB_ROOT_PASSWORD[$CELL]=$(cat ${TRIPLEO_PASSWORDS[$CELL]} | grep ' MysqlRootPassword:' | awk -F ': ' '{ print $2; }') done
The variable TRIPLEO_PASSWORDS is used inconsistently
First it is defined as an array
declare -A TRIPLEO_PASSWORDS
Next it is used as file
base64 -d >"$TRIPLEO_PASSWORDS[$CELL]"
Lastly it is used is is used as an array but parsed as a file
SOURCE_DB_ROOT_PASSWORD[$CELL]=$(cat ${TRIPLEO_PASSWORDS[$CELL]}
Removing the {} from
${TRIPLEO_PASSWORDS[$CELL]}
Allows this to work cause it can cat the file '[default]' created.
I know this type of array can work in bash, but I don't believe it is technically supported and can behave in unexpected ways between versions