mirror of
https://github.com/containers/podman.git
synced 2025-06-17 15:08:08 +08:00
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>
This commit is contained in:
@ -56,7 +56,7 @@ class ContainerTestCase(APITestCase):
|
||||
self.assertEqual(r.status_code, 200, r.text)
|
||||
self.assertId(r.content)
|
||||
out = r.json()
|
||||
self.assertIsNone(out["State"].get("Health"))
|
||||
self.assertIsNotNone(out["State"].get("Health"))
|
||||
self.assertListEqual(["CMD", "pidof", "top"], out["Config"]["Healthcheck"]["Test"])
|
||||
self.assertEqual(5000000000, out["Config"]["Healthcheck"]["Interval"])
|
||||
self.assertEqual(2000000000, out["Config"]["Healthcheck"]["Timeout"])
|
||||
|
Reference in New Issue
Block a user