aboutsummaryrefslogtreecommitdiff
path: root/libpod/events/nullout.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-12 19:55:15 +0200
committerGitHub <noreply@github.com>2022-09-12 19:55:15 +0200
commit6e545945a562b0116aa18ab0f38b36c59166838e (patch)
tree0dd37a72a795a61dcda08423d7aeac37e9ba5c94 /libpod/events/nullout.go
parent8432ed7488e9c62738f9308fcc03f2ae9c2cd615 (diff)
parenta63a40c3eece95e96e5b52a00646998606c5f82c (diff)
downloadpodman-6e545945a562b0116aa18ab0f38b36c59166838e.tar.gz
podman-6e545945a562b0116aa18ab0f38b36c59166838e.tar.bz2
podman-6e545945a562b0116aa18ab0f38b36c59166838e.zip
Merge pull request #15717 from Luap99/events
fix several podman events issues
Diffstat (limited to 'libpod/events/nullout.go')
-rw-r--r--libpod/events/nullout.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/libpod/events/nullout.go b/libpod/events/nullout.go
index 587a1b98b..da3820c23 100644
--- a/libpod/events/nullout.go
+++ b/libpod/events/nullout.go
@@ -2,10 +2,11 @@ package events
import (
"context"
+ "errors"
)
-// EventToNull is an eventer type that only performs write operations
-// and only writes to /dev/null. It is meant for unittests only
+// EventToNull is an eventer type that does nothing.
+// It is meant for unittests only
type EventToNull struct{}
// Write eats the event and always returns nil
@@ -13,14 +14,14 @@ func (e EventToNull) Write(ee Event) error {
return nil
}
-// Read does nothing. Do not use it.
+// Read does nothing and returns an error.
func (e EventToNull) Read(ctx context.Context, options ReadOptions) error {
- return nil
+ return errors.New("cannot read events with the \"none\" backend")
}
-// NewNullEventer returns a new null eventer. You should only do this for
+// newNullEventer returns a new null eventer. You should only do this for
// the purposes of internal libpod testing.
-func NewNullEventer() Eventer {
+func newNullEventer() Eventer {
return EventToNull{}
}