diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-14 13:13:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-14 13:13:02 -0400 |
commit | ab4d0cf908e9d24d321b52b419ebfb4ab5802029 (patch) | |
tree | 6b7fd144a2507e0a9161e11c671aa140f7429bc1 /pkg/domain | |
parent | 41fcd4d8ed9225e18f0d0d7c35b1916d14ceaf00 (diff) | |
parent | 60752b3206c8e950c9ba496917ed39f3cab548d6 (diff) | |
download | podman-ab4d0cf908e9d24d321b52b419ebfb4ab5802029.tar.gz podman-ab4d0cf908e9d24d321b52b419ebfb4ab5802029.tar.bz2 podman-ab4d0cf908e9d24d321b52b419ebfb4ab5802029.zip |
Merge pull request #10658 from mheon/bump_321
Bump to v3.2.1
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/entities/events.go | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/pkg/domain/entities/events.go b/pkg/domain/entities/events.go index 930ca53ae..5e7cc9ad1 100644 --- a/pkg/domain/entities/events.go +++ b/pkg/domain/entities/events.go @@ -30,29 +30,41 @@ func ConvertToLibpodEvent(e Event) *libpodEvents.Event { if err != nil { return nil } + image := e.Actor.Attributes["image"] + name := e.Actor.Attributes["name"] + details := e.Actor.Attributes + delete(details, "image") + delete(details, "name") + delete(details, "containerExitCode") return &libpodEvents.Event{ ContainerExitCode: exitCode, ID: e.Actor.ID, - Image: e.Actor.Attributes["image"], - Name: e.Actor.Attributes["name"], + Image: image, + Name: name, Status: status, Time: time.Unix(e.Time, e.TimeNano), Type: t, + Details: libpodEvents.Details{ + Attributes: details, + }, } } // ConvertToEntitiesEvent converts a libpod event to an entities one. func ConvertToEntitiesEvent(e libpodEvents.Event) *Event { + attributes := e.Details.Attributes + if attributes == nil { + attributes = make(map[string]string) + } + attributes["image"] = e.Image + attributes["name"] = e.Name + attributes["containerExitCode"] = strconv.Itoa(e.ContainerExitCode) return &Event{dockerEvents.Message{ Type: e.Type.String(), Action: e.Status.String(), Actor: dockerEvents.Actor{ - ID: e.ID, - Attributes: map[string]string{ - "image": e.Image, - "name": e.Name, - "containerExitCode": strconv.Itoa(e.ContainerExitCode), - }, + ID: e.ID, + Attributes: attributes, }, Scope: "local", Time: e.Time.Unix(), |