Skip to content

Commit

Permalink
Use database pattern in containers removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammedz93 committed Jul 2, 2023
1 parent 251c47a commit 8be655f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/image_config/reset-factory/reset-factory
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ if [ "$FACTORY_TYPE" != "only-config" ]; then
fi

echo "Remove all docker containers except the database"
database_array=($(docker ps -a -q -f "name=database"))
docker rm -f $(docker ps -a -q | egrep -v $(IFS='|'; echo "${database_array[*]}")) > /dev/null
database_pattern=($(docker ps -a -q -f "name=database" | paste -sd '|' -))
docker rm -f $(docker ps -a -q | egrep -v ${database_pattern}) > /dev/null

echo "Clear sonic directory"
clear_sonic_dir
Expand Down

0 comments on commit 8be655f

Please sign in to comment.