Skip to content

Commit

Permalink
go back to getting matching containers by name
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertdeng123 committed Dec 18, 2024
1 parent 72d520b commit 08b2e2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions devservices/utils/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def wait_for_healthy(container_name: str, status: Status) -> None:

def get_matching_containers(label: str) -> list[str]:
"""
Returns a list of container IDs with the given label
Returns a list of container names with the given label
"""
check_docker_daemon_running()
try:
Expand All @@ -87,7 +87,8 @@ def get_matching_containers(label: str) -> list[str]:
[
"docker",
"ps",
"-q",
"--format",
"{{.Names}}",
"--filter",
f"label={label}",
],
Expand Down
6 changes: 4 additions & 2 deletions tests/utils/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def test_get_matching_containers(
[
"docker",
"ps",
"-q",
"--format",
"{{.Names}}",
"--filter",
f"label={DEVSERVICES_ORCHESTRATOR_LABEL}",
],
Expand Down Expand Up @@ -90,7 +91,8 @@ def test_get_matching_containers_error(
[
"docker",
"ps",
"-q",
"--format",
"{{.Names}}",
"--filter",
f"label={DEVSERVICES_ORCHESTRATOR_LABEL}",
],
Expand Down

0 comments on commit 08b2e2f

Please sign in to comment.