mirror of
https://github.com/containers/podman.git
synced 2025-05-17 23:26:08 +08:00
use events_logfile_path from containers.conf for events log.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -500,8 +500,6 @@ func WithEventsLogger(logger string) RuntimeOption {
|
||||
}
|
||||
|
||||
rt.config.Engine.EventsLogger = logger
|
||||
rt.config.Engine.EventsLogFilePath = filepath.Join(rt.config.Engine.TmpDir, "events", "events.log")
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
@ -1114,7 +1114,9 @@ func (r *Runtime) mergeDBConfig(dbConfig *DBConfig) {
|
||||
logrus.Debugf("Overriding tmp dir %q with %q from database", c.TmpDir, dbConfig.LibpodTmp)
|
||||
}
|
||||
c.TmpDir = dbConfig.LibpodTmp
|
||||
c.EventsLogFilePath = filepath.Join(dbConfig.LibpodTmp, "events", "events.log")
|
||||
if c.EventsLogFilePath == "" {
|
||||
c.EventsLogFilePath = filepath.Join(dbConfig.LibpodTmp, "events", "events.log")
|
||||
}
|
||||
}
|
||||
|
||||
if !r.storageSet.VolumePathSet && dbConfig.VolumePath != "" {
|
||||
|
@ -116,3 +116,16 @@ function _events_disjunctive_filters() {
|
||||
@test "events with disjunctive filters - default" {
|
||||
_events_disjunctive_filters ""
|
||||
}
|
||||
|
||||
@test "events with events_logfile_path in containers.conf" {
|
||||
skip_if_remote "remote does not support --events-backend"
|
||||
events_file=$PODMAN_TMPDIR/events.log
|
||||
containersconf=$PODMAN_TMPDIR/containers.conf
|
||||
cat >$containersconf <<EOF
|
||||
[engine]
|
||||
events_logfile_path="$events_file"
|
||||
EOF
|
||||
CONTAINERS_CONF="$containersconf" run_podman --events-backend=file pull $IMAGE
|
||||
run cat $events_file
|
||||
is "$output" ".*\"Name\":\"$IMAGE" "test"
|
||||
}
|
||||
|
Reference in New Issue
Block a user