mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
Merge pull request #12461 from hurf/humanize_time2
Print human readable time for event
This commit is contained in:
commit
4593478c65
@ -927,8 +927,8 @@ func DescribeEvents(el *api.EventList, w io.Writer) {
|
|||||||
fmt.Fprint(w, "Events:\n FirstSeen\tLastSeen\tCount\tFrom\tSubobjectPath\tReason\tMessage\n")
|
fmt.Fprint(w, "Events:\n FirstSeen\tLastSeen\tCount\tFrom\tSubobjectPath\tReason\tMessage\n")
|
||||||
for _, e := range el.Items {
|
for _, e := range el.Items {
|
||||||
fmt.Fprintf(w, " %s\t%s\t%d\t%v\t%v\t%v\t%v\n",
|
fmt.Fprintf(w, " %s\t%s\t%d\t%v\t%v\t%v\t%v\n",
|
||||||
e.FirstTimestamp.Time.Format(time.RFC1123Z),
|
translateTimestamp(e.FirstTimestamp),
|
||||||
e.LastTimestamp.Time.Format(time.RFC1123Z),
|
translateTimestamp(e.LastTimestamp),
|
||||||
e.Count,
|
e.Count,
|
||||||
e.Source,
|
e.Source,
|
||||||
e.InvolvedObject.FieldPath,
|
e.InvolvedObject.FieldPath,
|
||||||
|
@ -850,8 +850,8 @@ func printEvent(event *api.Event, w io.Writer, withNamespace bool, wide bool, co
|
|||||||
}
|
}
|
||||||
if _, err := fmt.Fprintf(
|
if _, err := fmt.Fprintf(
|
||||||
w, "%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s",
|
w, "%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s",
|
||||||
event.FirstTimestamp.Time.Format(time.RFC1123Z),
|
translateTimestamp(event.FirstTimestamp),
|
||||||
event.LastTimestamp.Time.Format(time.RFC1123Z),
|
translateTimestamp(event.LastTimestamp),
|
||||||
event.Count,
|
event.Count,
|
||||||
event.InvolvedObject.Name,
|
event.InvolvedObject.Name,
|
||||||
event.InvolvedObject.Kind,
|
event.InvolvedObject.Kind,
|
||||||
|
Loading…
Reference in New Issue
Block a user