diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-07-17 15:17:26 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-07-31 17:28:42 -0400 |
commit | cdd5639d564624a6fbca426421d47c840dac8556 (patch) | |
tree | f3d803155a430f22150d5cf04ebfe3683cfe846a /libpod/events/events.go | |
parent | fd73075cbe91a4b38fe835b1f17bbabe0971bad9 (diff) | |
download | podman-cdd5639d564624a6fbca426421d47c840dac8556.tar.gz podman-cdd5639d564624a6fbca426421d47c840dac8556.tar.bz2 podman-cdd5639d564624a6fbca426421d47c840dac8556.zip |
Expose Null eventer and allow its use in the Podman CLI
We need this specifically for tests, but others may find it
useful if they don't explicitly need events and don't want the
performance implications of using them.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/events/events.go')
-rw-r--r-- | libpod/events/events.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libpod/events/events.go b/libpod/events/events.go index a898171c1..a80e97e90 100644 --- a/libpod/events/events.go +++ b/libpod/events/events.go @@ -16,11 +16,16 @@ var ErrNoJournaldLogging = errors.New("No support for journald logging") // String returns a string representation of EventerType func (et EventerType) String() string { - if et == LogFile { + switch et { + case LogFile: return "file" - + case Journald: + return "journald" + case Null: + return "null" + default: + return "invalid" } - return "journald" } // IsValidEventer checks if the given string is a valid eventer type. @@ -30,6 +35,8 @@ func IsValidEventer(eventer string) bool { return true case Journald.String(): return true + case Null.String(): + return true default: return false } |