remote events: fix --stream=false

Fix a bug in remote events where only one event would be sent if when
streaming is turned off.  The source of the bug was that the handler
attempted to implement the streaming logic and did it wrong.  The fix is
rather simple by removing this logic from the handler and let the events
backend handle streaming.

Fixes: 
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2021-06-04 11:28:00 +02:00
parent b64e20a53d
commit 86610c7852
2 changed files with 2 additions and 4 deletions
pkg/api/handlers/compat
test/system

@ -75,7 +75,7 @@ func GetEvents(w http.ResponseWriter, r *http.Request) {
coder := json.NewEncoder(w) coder := json.NewEncoder(w)
coder.SetEscapeHTML(true) coder.SetEscapeHTML(true)
for stream := true; stream; stream = query.Stream { for {
select { select {
case err := <-errorChannel: case err := <-errorChannel:
if err != nil { if err != nil {

@ -27,7 +27,7 @@ load helpers
} }
@test "image events" { @test "image events" {
skip_if_remote "FIXME: remove events on podman-remote seem to be broken" skip_if_remote "remote does not support --events-backend"
pushedDir=$PODMAN_TMPDIR/dir pushedDir=$PODMAN_TMPDIR/dir
mkdir -p $pushedDir mkdir -p $pushedDir
@ -86,7 +86,5 @@ function _events_disjunctive_filters() {
} }
@test "events with disjunctive filters - default" { @test "events with disjunctive filters - default" {
# NOTE: the last event for bar doesn't show up reliably.
skip_if_remote "FIXME #10529: remote events lose data"
_events_disjunctive_filters "" _events_disjunctive_filters ""
} }