Skip to content

Commit

Permalink
[docker-database-init.sh]: Fix wrong creating of database_global.json…
Browse files Browse the repository at this point in the history
… in multi asic platform (sonic-net#17221)

Fix bug: sonic-net#17161 (comment)
multi-asic platforms it will never go to the else part as DATABASE_TYPE is always ""


Microsoft ADO (number only): 25072889

Move the checker NAMESPACE_ID == "" back

Signed-off-by: Ze Gan <ganze718@gmail.com>
  • Loading branch information
Pterosaur authored Nov 21, 2023
1 parent ee38e24 commit a87cddc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dockers/docker-database/docker-database-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ if [[ $DATABASE_TYPE == "chassisdb" ]]; then
exit 0
fi

# copy/generate the database_global.json file if this is global database service in multi asic platform.
if [[ $DATABASE_TYPE == "" ]] && [[ $NAMESPACE_COUNT -gt 1 || $NUM_DPU -gt 1 ]]
# copy/generate the database_global.json file if this is global database service in multi asic/smart switch platform.
if [[ $NAMESPACE_ID == "" && $DATABASE_TYPE == "" && ( $NAMESPACE_COUNT -gt 1 || $NUM_DPU -gt 1) ]]
then
if [ -f /etc/sonic/database_global.json ]; then
cp /etc/sonic/database_global.json $REDIS_DIR/sonic-db/database_global.json
Expand Down

0 comments on commit a87cddc

Please sign in to comment.