From 74fcd9fef3a31fa94f3487361b5fda1180e8cee2 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 11 Dec 2020 17:02:21 +0100 Subject: podman events allow future time for --until The podman events aren't read until the given timestamp if the timestamp is in the future. It just reads all events until now and exits afterwards. This does not make sense and does not match docker. The correct behavior is to read all events until the given time is reached. This fixes a bug where the wrong event log file path was used when running first time with a new storage location. Fixes #8694 This also fixes the events api endpoint which only exited when an error occurred. Otherwise it just hung after reading all events. Signed-off-by: Paul Holzinger --- pkg/api/handlers/compat/events.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go index f74491a8f..c75511a4d 100644 --- a/pkg/api/handlers/compat/events.go +++ b/pkg/api/handlers/compat/events.go @@ -110,6 +110,7 @@ func GetEvents(w http.ResponseWriter, r *http.Request) { Until: query.Until, } errorChannel <- runtime.Events(r.Context(), readOpts) + }() var flush = func() {} @@ -130,8 +131,8 @@ func GetEvents(w http.ResponseWriter, r *http.Request) { if err != nil { // FIXME StatusOK already sent above cannot send 500 here utils.InternalServerError(w, err) - return } + return case evt := <-eventChannel: if evt == nil { continue -- cgit v1.2.3-54-g00ecf