spiegel_podman/pkg/api
crawfordxx fdf663b079 compat: map internal states to Docker equivalents in LibpodToContainer
The Docker compat /containers/json endpoint was leaking podman-internal
container states ("stopped", "stopping") that are not valid Docker API
states. Docker clients that strictly validate the State field against
the documented set ("created", "running", "paused", "restarting",
"exited", "removing", "dead") would fail with deserialization errors.

LibpodToContainerJSON already performs this mapping correctly:
- "stopped" → "exited"
- "stopping" → "running"

Apply the same remapping in LibpodToContainer using a switch statement
so the list endpoint behaves consistently with the inspect endpoint.

Add a test assertion to the compat /containers/json test to verify
that a stopped container is reported with State="exited".

Fixes #28359

Signed-off-by: crawfordxx <crawfordxx@users.noreply.github.com>
2026-03-29 12:04:46 +08:00
..
grpcpb enable gofumpt formatter 2025-11-11 12:32:46 +01:00
handlers compat: map internal states to Docker equivalents in LibpodToContainer 2026-03-29 12:04:46 +08:00
server Merge pull request #28224 from simonbrauner/libpod-pull-progress 2026-03-24 10:43:32 +01:00
types set !remote build tags where needed 2024-08-19 11:41:28 +02:00
Makefile api/compat: switch to moby/moby 2026-03-09 11:09:23 +01:00
tags.yaml [docs] Refactor Artifact API documentation 2025-08-19 10:22:00 +10:00