mirror of
https://github.com/containers/podman.git
synced 2025-12-16 03:57:36 +08:00
For Status = "die", Docker sets the exit code of the container to a field "exitCode". Podman uses "containerExitCode". Copy the value into "exitCode" as well, for compatibility. Signed-off-by: Leah Neukirchen <leah@vuxu.org>
28 lines
718 B
Bash
28 lines
718 B
Bash
# -*- sh -*-
|
|
#
|
|
# test container-related events
|
|
#
|
|
|
|
podman pull $IMAGE &>/dev/null
|
|
|
|
# Ensure clean slate
|
|
podman rm -a -f &>/dev/null
|
|
|
|
START=$(date +%s)
|
|
|
|
podman run $IMAGE false || true
|
|
|
|
# libpod api
|
|
t GET "libpod/events?stream=false&since=$START" 200 \
|
|
'select(.status | contains("start")).Action=start' \
|
|
'select(.status | contains("died")).Action=died' \
|
|
'select(.status | contains("died")).Actor.Attributes.containerExitCode=1'
|
|
|
|
# compat api, uses status=die (#12643)
|
|
t GET "events?stream=false&since=$START" 200 \
|
|
'select(.status | contains("start")).Action=start' \
|
|
'select(.status | contains("die")).Action=die' \
|
|
'select(.status | contains("die")).Actor.Attributes.exitCode=1'
|
|
|
|
# vim: filetype=sh
|