summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpod/events/events.go5
-rw-r--r--libpod/events/journal_linux.go7
2 files changed, 8 insertions, 4 deletions
diff --git a/libpod/events/events.go b/libpod/events/events.go
index 533eccbb8..202c9db4e 100644
--- a/libpod/events/events.go
+++ b/libpod/events/events.go
@@ -92,7 +92,7 @@ func StringToType(name string) (Type, error) {
case Volume.String():
return Volume, nil
}
- return "", errors.Errorf("unknown event type %s", name)
+ return "", errors.Errorf("unknown event type %q", name)
}
// StringToStatus converts a string to an Event Status
@@ -111,7 +111,6 @@ func StringToStatus(name string) (Status, error) {
case Commit.String():
return Commit, nil
case Create.String():
-
return Create, nil
case Exec.String():
return Exec, nil
@@ -164,7 +163,7 @@ func StringToStatus(name string) (Status, error) {
case Untag.String():
return Untag, nil
}
- return "", errors.Errorf("unknown event status %s", name)
+ return "", errors.Errorf("unknown event status %q", name)
}
func (e EventLogFile) getTail(options ReadOptions) (*tail.Tail, error) {
diff --git a/libpod/events/journal_linux.go b/libpod/events/journal_linux.go
index e6b54db1d..8ba5bc2c7 100644
--- a/libpod/events/journal_linux.go
+++ b/libpod/events/journal_linux.go
@@ -7,6 +7,7 @@ import (
"github.com/coreos/go-systemd/journal"
"github.com/coreos/go-systemd/sdjournal"
"github.com/pkg/errors"
+ "github.com/sirupsen/logrus"
)
// EventJournalD is the journald implementation of an eventer
@@ -87,7 +88,11 @@ func (e EventJournalD) Read(options ReadOptions) error {
}
newEvent, err := newEventFromJournalEntry(entry)
if err != nil {
- return err
+ // We can't decode this event.
+ // Don't fail hard - that would make events unusable.
+ // Instead, log and continue.
+ logrus.Errorf("Unable to decode event: %v", err)
+ continue
}
include := true
for _, filter := range eventOptions {