mirror of
https://github.com/containers/podman.git
synced 2025-06-28 06:18:57 +08:00
Merge pull request #11529 from n1hility/fix-oldfields
Add deprecated event fields for 1.22+ clients that still expect them
This commit is contained in:
@ -60,6 +60,10 @@ func ConvertToEntitiesEvent(e libpodEvents.Event) *Event {
|
|||||||
attributes["name"] = e.Name
|
attributes["name"] = e.Name
|
||||||
attributes["containerExitCode"] = strconv.Itoa(e.ContainerExitCode)
|
attributes["containerExitCode"] = strconv.Itoa(e.ContainerExitCode)
|
||||||
return &Event{dockerEvents.Message{
|
return &Event{dockerEvents.Message{
|
||||||
|
// Compatibility with clients that still look for deprecated API elements
|
||||||
|
Status: e.Status.String(),
|
||||||
|
ID: e.ID,
|
||||||
|
From: e.Image,
|
||||||
Type: e.Type.String(),
|
Type: e.Type.String(),
|
||||||
Action: e.Status.String(),
|
Action: e.Status.String(),
|
||||||
Actor: dockerEvents.Actor{
|
Actor: dockerEvents.Actor{
|
||||||
|
@ -29,6 +29,14 @@ class SystemTestCase(APITestCase):
|
|||||||
obj = json.loads(line)
|
obj = json.loads(line)
|
||||||
# Actor.ID is uppercase for compatibility
|
# Actor.ID is uppercase for compatibility
|
||||||
self.assertIn("ID", obj["Actor"])
|
self.assertIn("ID", obj["Actor"])
|
||||||
|
# Verify 1.22+ deprecated variants are present if current originals are
|
||||||
|
if (obj["Actor"]["ID"]):
|
||||||
|
self.assertEqual(obj["Actor"]["ID"], obj["id"])
|
||||||
|
if (obj["Action"]):
|
||||||
|
self.assertEqual(obj["Action"], obj["status"])
|
||||||
|
if (obj["Actor"].get("Attributes") and obj["Actor"]["Attributes"].get("image")):
|
||||||
|
self.assertEqual(obj["Actor"]["Attributes"]["image"], obj["from"])
|
||||||
|
|
||||||
|
|
||||||
def test_ping(self):
|
def test_ping(self):
|
||||||
required_headers = (
|
required_headers = (
|
||||||
|
Reference in New Issue
Block a user