mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +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:
@ -2,9 +2,11 @@ package libpod
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/containers/libpod/libpod/events"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Contains the public Runtime API for volumes
|
||||
@ -34,7 +36,6 @@ func (r *Runtime) RemoveVolume(ctx context.Context, v *Volume, force bool) error
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return r.removeVolume(ctx, v, force)
|
||||
}
|
||||
|
||||
@ -171,6 +172,7 @@ func (r *Runtime) PruneVolumes(ctx context.Context) ([]string, []error) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
vol.newVolumeEvent(events.Prune)
|
||||
prunedIDs = append(prunedIDs, vol.Name())
|
||||
}
|
||||
return prunedIDs, pruneErrors
|
||||
|
Reference in New Issue
Block a user