spiegel_podman/pkg/domain/entities
Paul Holzinger 768ad8653a
rework event code to improve API errors
One of the problems with the Events() API was that you had to call it in
a new goroutine. This meant the the error returned by it had to be read
back via a second channel. This cuased other bugs in the past but here
the biggest problem is that basic errors such as invalid since/until
options were not directly returned to the caller.
It meant in the API we were not able to write http code 200 quickly
because we always waited for the first event or error from the
channels. This in turn made some clients not happy as they assume the
server hangs on time out if no such events are generated.

To fix this we resturcture the entire event flow. First we spawn the
goroutine inside the eventer Read() function so not all the callers have
to. Then we can return the basic error quickly without the goroutine.
The caller then checks the error like any normal function and the API
can use this one to decide which status code to return.
Second we now return errors/event in one channel then the callers can
decide to ignore or log them which makes it a bit more clear.

Fixes c46884aa93 ("podman events: check for an error after we finish reading events")
Fixes #23712

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 18:54:13 +01:00
..
reports Removing the RawInput from the API output 2022-11-17 15:41:01 +09:00
types Add podman system check for checking storage consistency 2024-06-04 10:00:37 -04:00
apply.go Add podman kube apply command 2022-11-01 15:30:17 -04:00
auto-update.go auto update: fix usage of --authfile 2023-07-05 08:30:39 +02:00
container_ps.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
containers.go cleanup: add new --stopped-only option 2024-08-27 15:01:23 +02:00
engine.go remote: fix incorrect CONTAINER_CONNECTION parsing 2024-06-21 14:01:22 +02:00
engine_container.go Add podman system check for checking storage consistency 2024-06-04 10:00:37 -04:00
engine_image.go scp: add option types 2024-10-14 21:46:55 -04:00
events.go properly implement pull-error event status 2024-03-05 10:50:42 +01:00
filters.go Swagger refactor/cleanup 2022-05-19 15:24:18 -07:00
generate.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
healthcheck.go podmanv2 enable healthcheck run 2020-03-29 18:48:29 -05:00
images.go scp: add option types 2024-10-14 21:46:55 -04:00
machine.go Add disclaimer to podman machine info manpage. 2024-09-03 15:23:18 -04:00
manifest.go swagger fix infinitive recursion on some types 2024-04-12 15:26:34 +02:00
network.go swagger fix infinitive recursion on some types 2024-04-12 15:26:34 +02:00
play.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
pods.go Add --health-max-log-count, --health-max-log-size, --health-log-destination flags 2024-09-25 14:01:35 +02:00
scp.go scp: add option types 2024-10-14 21:46:55 -04:00
secrets.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
set.go Fix Id->ID where possible for lint 2020-06-10 05:49:41 -04:00
system.go Add podman system check for checking storage consistency 2024-06-04 10:00:37 -04:00
types.go rework event code to improve API errors 2024-11-01 18:54:13 +01:00
volumes.go swagger fix infinitive recursion on some types 2024-04-12 15:26:34 +02:00