Skip to content

Commit cb73bc1

Browse files
committed
Enhance container query to list all containers, excluding infra containers
CMK-29116 Change-Id: I3a189ae5aef91abd343599b6a0efc8b4cf825f06
1 parent 780ca9c commit cb73bc1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

agents/plugins/mk_podman.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ def query_containers(
145145
) -> Union[JSONSection, Error]:
146146
endpoint = "/v4.0.0/libpod/containers/json"
147147
try:
148-
response = session.get(build_url_callable(socket_path, endpoint))
148+
response = session.get(build_url_callable(socket_path, endpoint), params={"all": "true"})
149149
response.raise_for_status()
150-
output = response.json()
150+
output = [c for c in response.json() if not c.get("IsInfra", False)]
151151
except Exception as e:
152152
return Error(build_url_human_readable(socket_path, endpoint), str(e))
153153
return JSONSection("containers", json.dumps(output))

0 commit comments

Comments
 (0)