diff options
author | baude <bbaude@redhat.com> | 2020-10-21 11:59:35 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2020-10-23 12:07:34 -0500 |
commit | c593e49701b3a4bb48050f3d8829f2fe6ac457ef (patch) | |
tree | f69648182082c37d4416efdb5405a9431984463c /libpod/events.go | |
parent | 51fa8ded9ffb7924288a2728ce92af7f6cc66d34 (diff) | |
download | podman-c593e49701b3a4bb48050f3d8829f2fe6ac457ef.tar.gz podman-c593e49701b3a4bb48050f3d8829f2fe6ac457ef.tar.bz2 podman-c593e49701b3a4bb48050f3d8829f2fe6ac457ef.zip |
filter events by labels
adding the ability to filter evens by the container labels. this requires that container labels be added to the events data being recorded and subsequently read.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/events.go')
-rw-r--r-- | libpod/events.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/events.go b/libpod/events.go index b519fe324..95317eb01 100644 --- a/libpod/events.go +++ b/libpod/events.go @@ -26,6 +26,12 @@ func (c *Container) newContainerEvent(status events.Status) { e.Name = c.Name() e.Image = c.config.RootfsImageName e.Type = events.Container + + e.Details = events.Details{ + ID: e.ID, + Attributes: c.Labels(), + } + if err := c.runtime.eventer.Write(e); err != nil { logrus.Errorf("unable to write pod event: %q", err) } |