A container named api_gw is configured with a health check. An administrator needs to check the current health status (e.g., healthy, unhealthy, starting) using the command line without reading the full inspect JSON. Which command string achieves this?
Trap 1: podman health status api_gw
podman health is not a top-level subcommand.
Trap 2: podman ps --filter health=unhealthy
While ps has filters, health checking filter syntax is different, and this does not provide a direct quick view of status like inspect formatting does.
Trap 3: podman status api_gw
podman status is not a valid command.
- A
podman inspect --format='{{json .State.Health.Status}}' api_gw
This inspect command uses a Go template to extract the exact health status string from the container state.
- B
podman health status api_gw
Why it fails: podman health is not a top-level subcommand.
- C
podman ps --filter health=unhealthy
Why it fails: While ps has filters, health checking filter syntax is different, and this does not provide a direct quick view of status like inspect formatting does.
- D
podman status api_gw
Why it fails: podman status is not a valid command.