fix hang with podman events file logger

podman --events-backend file events --stream=false should never hang. The
problem is that our tail library will wait for the file to be created
which makes sense when we do not run with --stream=false. To fix this we
can just always create the file when the logger is initialized. This
would also help to report errors early on in case the file is not
accessible.

Fixes part one from #15688

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2022-09-09 11:07:07 +02:00
parent 5abc08df25
commit c5bdb6afe7
4 changed files with 24 additions and 10 deletions

View File

@ -18,7 +18,7 @@ func NewEventer(options EventerOptions) (Eventer, error) {
}
return eventer, nil
case strings.ToUpper(LogFile.String()):
return EventLogFile{options}, nil
return newLogFileEventer(options)
case strings.ToUpper(Null.String()):
return NewNullEventer(), nil
case strings.ToUpper(Memory.String()):