diff options
author | baude <bbaude@redhat.com> | 2019-02-28 14:15:56 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-03-11 15:08:59 -0500 |
commit | ca1e76ff632dec0b0e00e25f26677887ca8cc625 (patch) | |
tree | bf5c231a826f4ce15d52a6d4e52e0b11abeb85f0 /libpod/runtime_ctr.go | |
parent | 6421208e0f6ff1fba58eafdab12e897b5ed12e3b (diff) | |
download | podman-ca1e76ff632dec0b0e00e25f26677887ca8cc625.tar.gz podman-ca1e76ff632dec0b0e00e25f26677887ca8cc625.tar.bz2 podman-ca1e76ff632dec0b0e00e25f26677887ca8cc625.zip |
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>
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index cfa4f9654..c6f119913 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -10,6 +10,7 @@ import ( "strings" "time" + "github.com/containers/libpod/libpod/events" "github.com/containers/libpod/libpod/image" "github.com/containers/libpod/pkg/rootless" "github.com/containers/storage" @@ -228,6 +229,7 @@ func (r *Runtime) newContainer(ctx context.Context, rSpec *spec.Spec, options .. return nil, err } } + ctr.newContainerEvent(events.Create) return ctr, nil } @@ -239,7 +241,6 @@ func (r *Runtime) newContainer(ctx context.Context, rSpec *spec.Spec, options .. func (r *Runtime) RemoveContainer(ctx context.Context, c *Container, force bool, removeVolume bool) error { r.lock.Lock() defer r.lock.Unlock() - return r.removeContainer(ctx, c, force, removeVolume) } @@ -430,6 +431,7 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool, } } + c.newContainerEvent(events.Remove) return cleanupErr } |