summaryrefslogtreecommitdiff
path: root/libpod/events/events.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/events/events.go')
-rw-r--r--libpod/events/events.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/libpod/events/events.go b/libpod/events/events.go
index e83c2efee..764481e51 100644
--- a/libpod/events/events.go
+++ b/libpod/events/events.go
@@ -2,16 +2,16 @@ package events
import (
"encoding/json"
+ "errors"
"fmt"
"time"
"github.com/containers/storage/pkg/stringid"
- "github.com/pkg/errors"
)
// ErrNoJournaldLogging indicates that there is no journald logging
// supported (requires libsystemd)
-var ErrNoJournaldLogging = errors.New("No support for journald logging")
+var ErrNoJournaldLogging = errors.New("no support for journald logging")
// String returns a string representation of EventerType
func (et EventerType) String() string {
@@ -76,7 +76,7 @@ func (e *Event) ToHumanReadable(truncate bool) string {
}
switch e.Type {
case Container, Pod:
- humanFormat = fmt.Sprintf("%s %s %s %s (image=%s, name=%s", e.Time, e.Type, e.Status, id, e.Image, e.Name)
+ humanFormat = fmt.Sprintf("%s %s %s %s (image=%s, name=%s, health_status=%s", e.Time, e.Type, e.Status, id, e.Image, e.Name, e.HealthStatus)
// check if the container has labels and add it to the output
if len(e.Attributes) > 0 {
for k, v := range e.Attributes {
@@ -140,12 +140,10 @@ func StringToType(name string) (Type, error) {
case "":
return "", ErrEventTypeBlank
}
- return "", errors.Errorf("unknown event type %q", name)
+ return "", fmt.Errorf("unknown event type %q", name)
}
// StringToStatus converts a string to an Event Status
-// TODO if we add more events, we might consider a go-generator to
-// create the switch statement
func StringToStatus(name string) (Status, error) {
switch name {
case Attach.String():
@@ -170,6 +168,8 @@ func StringToStatus(name string) (Status, error) {
return Exited, nil
case Export.String():
return Export, nil
+ case HealthStatus.String():
+ return HealthStatus, nil
case History.String():
return History, nil
case Import.String():
@@ -225,5 +225,5 @@ func StringToStatus(name string) (Status, error) {
case Untag.String():
return Untag, nil
}
- return "", errors.Errorf("unknown event status %q", name)
+ return "", fmt.Errorf("unknown event status %q", name)
}