mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
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>
This commit is contained in:
@ -10,6 +10,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/containerd/cgroups"
|
||||
"github.com/containers/libpod/libpod/events"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@ -121,7 +122,7 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (*Pod,
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
pod.newPodEvent(events.Create)
|
||||
return pod, nil
|
||||
}
|
||||
|
||||
@ -307,6 +308,6 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool)
|
||||
|
||||
// Mark pod invalid
|
||||
p.valid = false
|
||||
|
||||
p.newPodEvent(events.Remove)
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user