diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-04-26 11:16:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-26 11:16:27 -0700 |
commit | e8ede74f5ef7b0d044c5d5344186fb998f676cec (patch) | |
tree | 9ee3a51fc6c94b9913da7b6097b4a4960372c766 /libpod/events/events.go | |
parent | a85155617fb1ed4248adb2169845f4a08ab88789 (diff) | |
parent | e05af783295c9f4a0b210c0e6d368cf8c6dfe7c6 (diff) | |
download | podman-e8ede74f5ef7b0d044c5d5344186fb998f676cec.tar.gz podman-e8ede74f5ef7b0d044c5d5344186fb998f676cec.tar.bz2 podman-e8ede74f5ef7b0d044c5d5344186fb998f676cec.zip |
Merge pull request #3019 from mheon/system_events
Add System event type and renumber, refresh events
Diffstat (limited to 'libpod/events/events.go')
-rw-r--r-- | libpod/events/events.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libpod/events/events.go b/libpod/events/events.go index e8c61faa0..202c9db4e 100644 --- a/libpod/events/events.go +++ b/libpod/events/events.go @@ -49,6 +49,8 @@ func (e *Event) ToHumanReadable() string { humanFormat = fmt.Sprintf("%s %s %s %s (image=%s, name=%s)", e.Time, e.Type, e.Status, e.ID, e.Image, e.Name) case Image: humanFormat = fmt.Sprintf("%s %s %s %s %s", e.Time, e.Type, e.Status, e.ID, e.Name) + case System: + humanFormat = fmt.Sprintf("%s %s %s", e.Time, e.Type, e.Status) case Volume: humanFormat = fmt.Sprintf("%s %s %s %s", e.Time, e.Type, e.Status, e.Name) } @@ -85,10 +87,12 @@ func StringToType(name string) (Type, error) { return Image, nil case Pod.String(): return Pod, nil + case System.String(): + return System, nil 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 @@ -107,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 @@ -135,8 +138,14 @@ func StringToStatus(name string) (Status, error) { return Pull, nil case Push.String(): return Push, nil + case Refresh.String(): + return Refresh, nil case Remove.String(): return Remove, nil + case Renumber.String(): + return Renumber, nil + case Restore.String(): + return Restore, nil case Save.String(): return Save, nil case Start.String(): @@ -154,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) { |