Skip to content

Commit 7aa84c9

Browse files
committed
Fix comments
Signed-off-by: Ze Gan <[email protected]>
1 parent 307b8c8 commit 7aa84c9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

dockers/docker-database/docker-database-init.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if [[ $DATABASE_TYPE == "chassisdb" ]]; then
7171
fi
7272

7373
# copy/generate the database_global.json file if this is global database service in multi asic platform.
74-
if [[ $NAMESPACE_ID == "" ]] && [[ $NAMESPACE_COUNT -gt 1 || $NUM_DPU -gt 1 ]]
74+
if [[ $DATABASE_TYPE == "" ]] && [[ $NAMESPACE_COUNT -gt 1 || $NUM_DPU -gt 1 ]]
7575
then
7676
if [ -f /etc/sonic/database_global.json ]; then
7777
cp /etc/sonic/database_global.json $REDIS_DIR/sonic-db/database_global.json

files/build_templates/docker_image_ctl.j2

+5-2
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function postStartAction()
223223
# databases are not availbale until database container is ready.
224224
# also chassisdb doesn't support warm/fast reboot, its dump.rdb is deleted
225225
# at service startup time, nothing need to be done here.
226-
if [ "$DATABASE_TYPE" != "chassisdb" ]; then
226+
if [[ "$DATABASE_TYPE" != "chassisdb" ]]; then
227227
# Wait until supervisord and redis starts. This change is needed
228228
# because now database_config.json is jinja2 templated based
229229
# and by the time file gets generated if we do redis ping
@@ -235,7 +235,7 @@ function postStartAction()
235235
# database-config.json files are not ready yet, it will generate the sonic-db-cli core files.
236236
waitForAllInstanceDatabaseConfigJsonFilesReady
237237
until [[ ($(docker exec -i database$DEV pgrep -x -c supervisord) -gt 0) && ($($SONIC_DB_CLI PING | grep -c PONG) -gt 0) &&
238-
($(docker exec -i database$DEV sonic-db-cli PING | grep -c PONG) -gt 0) ]]; do
238+
( "$DATABASE_TYPE" == "dpudb" || $(docker exec -i database$DEV sonic-db-cli PING | grep -c PONG) -gt 0) ]]; do
239239
sleep 1;
240240
done
241241

@@ -530,6 +530,9 @@ start() {
530530
DB_OPT=$DB_OPT" -v /var/run/redis$DEV:/var/run/redis:rw "
531531
DB_OPT=$DB_OPT" --env DATABASE_TYPE=$DATABASE_TYPE "
532532
DB_OPT=$DB_OPT" --env NUM_DPU=$NUM_DPU "
533+
if [[ "$DEV" ]]; then
534+
DB_OPT=$DB_OPT" -v /var/run/redis$DEV:/var/run/redis$DEV:rw "
535+
fi
533536
fi
534537
{%- endif %}
535538
else

0 commit comments

Comments
 (0)