diff options
author | Paul Holzinger <pholzing@redhat.com> | 2021-09-20 13:19:50 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2021-09-23 14:44:34 +0200 |
commit | 1199733754b1185d0d2a7a3d832c57565864d0f4 (patch) | |
tree | 20f7a33df89744836959f308e2faa8fa07f6ef95 /test/system | |
parent | aa628b82b1c2f04fb3a9a9207bb6d6bddb497fbb (diff) | |
download | podman-1199733754b1185d0d2a7a3d832c57565864d0f4.tar.gz podman-1199733754b1185d0d2a7a3d832c57565864d0f4.tar.bz2 podman-1199733754b1185d0d2a7a3d832c57565864d0f4.zip |
podman inspect add State.Health field for docker compat
podman inspect shows the healthcheck status in `.State.Healthcheck`,
docker uses `.State.Health`. To make sure docker scripts work we
should add the `Health` key. Because we do not want to display both keys
by default we only use the new `Health` key. This is a breaking change
for podman users but matches what docker does. To provide some form of
compatibility users can still use `--format {{.State.Healthcheck}}`. IT
is just not shown by default.
Fixes #11645
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/220-healthcheck.bats | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/system/220-healthcheck.bats b/test/system/220-healthcheck.bats index e416629e6..e5a0e7e88 100644 --- a/test/system/220-healthcheck.bats +++ b/test/system/220-healthcheck.bats @@ -12,13 +12,13 @@ function _check_health { local testname="$1" local tests="$2" - run_podman inspect --format json healthcheck_c + run_podman inspect --format "{{json .State.Healthcheck}}" healthcheck_c parse_table "$tests" | while read field expect;do # (kludge to deal with parse_table and empty strings) if [ "$expect" = "''" ]; then expect=""; fi - actual=$(jq -r ".[0].State.Healthcheck.$field" <<<"$output") + actual=$(jq -r ".$field" <<<"$output") is "$actual" "$expect" "$testname - .State.Healthcheck.$field" done } |