bundles/docker-engine: turns out, filtering by name means getting everything where the name contains the filter ...

This commit is contained in:
Franzi 2025-02-16 16:14:56 +01:00
parent 79680e2119
commit 45c52c62ca
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -18,7 +18,13 @@ try:
f'name={container_name}'
])
containers = loads(f"[{','.join([l for l in docker_ps.decode().splitlines() if l])}]")
docker_json = loads(f"[{','.join([l for l in docker_ps.decode().splitlines() if l])}]")
containers = [
container
for container in docker_json
if container['Names'] == container_name
]
if not containers:
print(f'CRITICAL: container {container_name} not found!')