Skip to content

Commit 9d6cedc

Browse files
Update docker stop
1 parent 629d6fe commit 9d6cedc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

nebula/controller.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,8 @@ def stop_frontend():
631631
try:
632632
# kill all the docker containers which contain the word "nebula"
633633
commands = [
634-
"""docker kill $(docker ps -q --filter name=nebula-frontend) | Out-Null""",
635-
"""docker rm $(docker ps -a -q --filter name=nebula-frontend) | Out-Null""",
634+
"""docker kill $(docker ps -q --filter name=^nebula-frontend$) | Out-Null""",
635+
"""docker rm $(docker ps -a -q --filter name=^nebula-frontend$) | Out-Null""",
636636
]
637637

638638
for command in commands:
@@ -645,8 +645,8 @@ def stop_frontend():
645645
else:
646646
try:
647647
commands = [
648-
"""docker kill $(docker ps -q --filter name=nebula-frontend) > /dev/null 2>&1""",
649-
"""docker rm $(docker ps -a -q --filter name=nebula-frontend) > /dev/null 2>&1""",
648+
"""docker kill $(docker ps -q --filter name=^nebula-frontend$) > /dev/null 2>&1""",
649+
"""docker rm $(docker ps -a -q --filter name=^nebula-frontend$) > /dev/null 2>&1""",
650650
]
651651

652652
for command in commands:
@@ -663,7 +663,7 @@ def stop_network():
663663
try:
664664
# kill all the docker containers which contain the word "nebula"
665665
commands = [
666-
r"""docker network rm $(docker network ls | Where-Object { ($_ -split '\s+')[1] -like 'nebula-net-base' } | ForEach-Object { ($_ -split '\s+')[0] }) | Out-Null"""
666+
r"""docker network rm $(docker network ls | Where-Object { ($_ -split '\s+')[1] -eq 'nebula-net-base' } | ForEach-Object { ($_ -split '\s+')[0] }) | Out-Null"""
667667
]
668668

669669
for command in commands:
@@ -676,7 +676,7 @@ def stop_network():
676676
else:
677677
try:
678678
commands = [
679-
"""docker network rm $(docker network ls | grep nebula-net-base | awk '{print $1}') > /dev/null 2>&1"""
679+
"""docker network rm $(docker network ls | grep '^nebula-net-base$' | awk '{print $1}') > /dev/null 2>&1"""
680680
]
681681

682682
for command in commands:

0 commit comments

Comments
 (0)