Print human readable time for event

Reduce the length of event time as AGE column does.
This commit is contained in:
hurf
2015-08-10 15:00:24 +08:00
parent 2bfa9a1f98
commit dd647db5ac
2 changed files with 4 additions and 4 deletions

View File

@@ -898,8 +898,8 @@ func DescribeEvents(el *api.EventList, w io.Writer) {
fmt.Fprint(w, "Events:\n FirstSeen\tLastSeen\tCount\tFrom\tSubobjectPath\tReason\tMessage\n")
for _, e := range el.Items {
fmt.Fprintf(w, " %s\t%s\t%d\t%v\t%v\t%v\t%v\n",
e.FirstTimestamp.Time.Format(time.RFC1123Z),
e.LastTimestamp.Time.Format(time.RFC1123Z),
translateTimestamp(e.FirstTimestamp),
translateTimestamp(e.LastTimestamp),
e.Count,
e.Source,
e.InvolvedObject.FieldPath,

View File

@@ -850,8 +850,8 @@ func printEvent(event *api.Event, w io.Writer, withNamespace bool, wide bool, co
}
if _, err := fmt.Fprintf(
w, "%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s",
event.FirstTimestamp.Time.Format(time.RFC1123Z),
event.LastTimestamp.Time.Format(time.RFC1123Z),
translateTimestamp(event.FirstTimestamp),
translateTimestamp(event.LastTimestamp),
event.Count,
event.InvolvedObject.Name,
event.InvolvedObject.Kind,