summaryrefslogtreecommitdiff
path: root/libpod/events/events.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-08-02 03:44:43 +0200
committerGitHub <noreply@github.com>2019-08-02 03:44:43 +0200
commite3240daa471dee1bbc118e6b3871c4a73890d0e0 (patch)
tree402bfadad932067a96635f799d3c3fd98282d5b2 /libpod/events/events.go
parente48dc506d18335b36d1ffbbc8df1890ee3b99e2c (diff)
parent8da24f2f7d3472d2be4ccde8e7b42790671d464f (diff)
downloadpodman-e3240daa471dee1bbc118e6b3871c4a73890d0e0.tar.gz
podman-e3240daa471dee1bbc118e6b3871c4a73890d0e0.tar.bz2
podman-e3240daa471dee1bbc118e6b3871c4a73890d0e0.zip
Merge pull request #3551 from mheon/fix_memory_leak
Fix memory leak with exit files
Diffstat (limited to 'libpod/events/events.go')
-rw-r--r--libpod/events/events.go23
1 files changed, 21 insertions, 2 deletions
diff --git a/libpod/events/events.go b/libpod/events/events.go
index 2bebff162..5e828bc8a 100644
--- a/libpod/events/events.go
+++ b/libpod/events/events.go
@@ -16,11 +16,30 @@ 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 "none"
+ default:
+ return "invalid"
+ }
+}
+// IsValidEventer checks if the given string is a valid eventer type.
+func IsValidEventer(eventer string) bool {
+ switch eventer {
+ case LogFile.String():
+ return true
+ case Journald.String():
+ return true
+ case Null.String():
+ return true
+ default:
+ return false
}
- return "journald"
}
// NewEvent creates a event struct and populates with