diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-23 20:39:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-23 20:39:56 +0200 |
commit | f658bbd230ed9cf6fbdabf5ddab5cfcf8f224636 (patch) | |
tree | fe84092f24438dd3a5d713f4439c1919552aaf5c /pkg/domain/entities/events.go | |
parent | 25dc2759e10bf0293f14a2205291ab7dd53eccf4 (diff) | |
parent | 6ee582315bfba8db13541406f6def26ecd8f6aeb (diff) | |
download | podman-f658bbd230ed9cf6fbdabf5ddab5cfcf8f224636.tar.gz podman-f658bbd230ed9cf6fbdabf5ddab5cfcf8f224636.tar.bz2 podman-f658bbd230ed9cf6fbdabf5ddab5cfcf8f224636.zip |
Merge pull request #15463 from mheon/fix_15408
Events for containers in pods now include the pod's ID
Diffstat (limited to 'pkg/domain/entities/events.go')
-rw-r--r-- | pkg/domain/entities/events.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/domain/entities/events.go b/pkg/domain/entities/events.go index de218b285..34a6fe048 100644 --- a/pkg/domain/entities/events.go +++ b/pkg/domain/entities/events.go @@ -14,7 +14,7 @@ type Event struct { // TODO: it would be nice to have full control over the types at some // point and fork such Docker types. dockerEvents.Message - HealthStatus string + HealthStatus string `json:",omitempty"` } // ConvertToLibpodEvent converts an entities event to a libpod one. @@ -34,6 +34,7 @@ func ConvertToLibpodEvent(e Event) *libpodEvents.Event { image := e.Actor.Attributes["image"] name := e.Actor.Attributes["name"] details := e.Actor.Attributes + podID := e.Actor.Attributes["podId"] delete(details, "image") delete(details, "name") delete(details, "containerExitCode") @@ -47,6 +48,7 @@ func ConvertToLibpodEvent(e Event) *libpodEvents.Event { Type: t, HealthStatus: e.HealthStatus, Details: libpodEvents.Details{ + PodID: podID, Attributes: details, }, } @@ -61,6 +63,7 @@ func ConvertToEntitiesEvent(e libpodEvents.Event) *Event { attributes["image"] = e.Image attributes["name"] = e.Name attributes["containerExitCode"] = strconv.Itoa(e.ContainerExitCode) + attributes["podId"] = e.PodID message := dockerEvents.Message{ // Compatibility with clients that still look for deprecated API elements Status: e.Status.String(), |