Commit graph

22 commits

Author SHA1 Message Date
OpenShift Merge Robot fff496436e
Merge pull request #3171 from QiWang19/events_json
podman events format json
2019-08-05 16:11:42 +02:00
baude 63eef5a234 add eventlogger to info
to help with future debugging, we now display the type of event logger
being used inside podman info -> host.

Signed-off-by: baude <bbaude@redhat.com>
2019-08-02 20:05:27 -05:00
Qi Wang 0ad374af6a podman events format json
Enable podman events to format the output as jsonline

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-08-02 11:47:43 -04:00
Matthew Heon 8da24f2f7d Use "none" instead of "null" for the null eventer
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-08-01 15:01:54 -04:00
Matthew Heon cc63aff571 System events are valid, don't error on them
The logfile driver was not aware that system events existed.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-31 17:28:42 -04:00
Matthew Heon cdd5639d56 Expose Null eventer and allow its use in the Podman CLI
We need this specifically for tests, but others may find it
useful if they don't explicitly need events and don't want the
performance implications of using them.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-31 17:28:42 -04:00
Matthew Heon 8e8d1ac193 Add a flag to set events logger type
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-07-31 17:28:42 -04:00
baude a78c885397 golangci-lint pass number 2
clean up and prepare to migrate to the golangci-linter

Signed-off-by: baude <bbaude@redhat.com>
2019-07-11 09:13:06 -05:00
baude d252100c94 get last container event
an internal change in libpod will soon required the ability to lookup
the last container event using the continer name or id and the type of
event.  this pr is in preperation for that need.

Signed-off-by: baude <bbaude@redhat.com>
2019-07-07 08:54:20 -05:00
baude 7a58c6601b set default event logger based on build tags
once the default event logger was removed from libpod.conf, we need to
set the default based on whether the systemd build tag is used or not.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-14 16:17:11 -05:00
Sascha Grunert d1fc3fc702
Add systemd build tag
If the systemd development files are not present on the system which
builds podman, then `podman events` will error on runtime creation.
Beside this, a warning will be printed when compiling podman.

This commit mainly exists because projects which depend on libpod
would not need the podman event support and therefore do not need to
rely on the systemd headers.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-05-13 14:00:27 +02:00
Matthew Heon 4d348d7839 Fix 'restart' event in journald
Ensure that we can decode the restart event with the new journald
events.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-03 10:43:14 -04:00
Matthew Heon cafb68e301 Add a restart event, and make one during restart policy
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-03 10:36:16 -04:00
Matthew Heon e05af78329 Do not hard fail on non-decodable events
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-26 10:50:57 -04:00
Matthew Heon 04d6ff0582 Add System event type and renumber, refresh events
Also, re-add locking to file eventer Write() to protect against
concurrent events.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-25 16:23:09 -04:00
baude 7bf7c177ab journald event logging
add the ability for podman to read and write events to journald instead
of just a logfile.  This can be controlled in libpod.conf with the
`events_logger` attribute of `journald` or `file`.  The default will be
set to `journald`.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-24 16:00:04 -05:00
OpenShift Merge Robot e435931544
Merge pull request #2801 from mheon/remove_wait_event
Remove wait event
2019-03-29 15:10:04 -07:00
Matthew Heon 99318b0894 Remove wait event
It's not necessary to log an event for a read-only operation like
wait.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-29 14:50:43 -04:00
Matthew Heon 8108801247 Add locking to ensure events file is concurrency-safe
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-29 12:51:37 -04:00
baude e730fc6093 Add "died" event
We have a new event for container 'Exited' which has been renamed to
'died'.

also removed the stream bool from the varlink endpoint for events
because it can be determined by the varlink more value.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-25 10:28:50 -05:00
Matthew Heon 3b5805d521 Add event on container death
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-13 10:18:51 -04:00
baude ca1e76ff63 Add event logging to libpod, even display to podman
In lipod, we now log major events that occurr.  These events
can be displayed using the `podman events` command. Each
event contains:

* Type (container, image, volume, pod...)
* Status (create, rm, stop, kill, ....)
* Timestamp in RFC3339Nano format
* Name (if applicable)
* Image (if applicable)

The format of the event and the varlink endpoint are to not
be considered stable until cockpit has done its enablement.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-11 15:08:59 -05:00