mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
Merge pull request #4306 from saad-ali/eventCompression1
Compress recurring events in to a single event to optimize etcd storage
This commit is contained in:
@@ -318,10 +318,12 @@ func describeEvents(el *api.EventList, w io.Writer) {
|
||||
return
|
||||
}
|
||||
sort.Sort(SortableEvents(el.Items))
|
||||
fmt.Fprint(w, "Events:\nTime\tFrom\tSubobjectPath\tReason\tMessage\n")
|
||||
fmt.Fprint(w, "Events:\nFirstSeen\tLastSeen\tCount\tFrom\tSubobjectPath\tReason\tMessage\n")
|
||||
for _, e := range el.Items {
|
||||
fmt.Fprintf(w, "%s\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),
|
||||
e.LastTimestamp.Time.Format(time.RFC1123Z),
|
||||
e.Count,
|
||||
e.Source,
|
||||
e.InvolvedObject.FieldPath,
|
||||
e.Reason,
|
||||
|
@@ -221,7 +221,7 @@ var serviceColumns = []string{"NAME", "LABELS", "SELECTOR", "IP", "PORT"}
|
||||
var endpointColumns = []string{"NAME", "ENDPOINTS"}
|
||||
var minionColumns = []string{"NAME", "LABELS", "STATUS"}
|
||||
var statusColumns = []string{"STATUS"}
|
||||
var eventColumns = []string{"TIME", "NAME", "KIND", "SUBOBJECT", "REASON", "SOURCE", "MESSAGE"}
|
||||
var eventColumns = []string{"FIRSTSEEN", "LASTSEEN", "COUNT", "NAME", "KIND", "SUBOBJECT", "REASON", "SOURCE", "MESSAGE"}
|
||||
var limitRangeColumns = []string{"NAME"}
|
||||
var resourceQuotaColumns = []string{"NAME"}
|
||||
var namespaceColumns = []string{"NAME", "LABELS"}
|
||||
@@ -423,8 +423,10 @@ func printStatus(status *api.Status, w io.Writer) error {
|
||||
|
||||
func printEvent(event *api.Event, w io.Writer) error {
|
||||
_, err := fmt.Fprintf(
|
||||
w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
|
||||
w, "%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\n",
|
||||
event.FirstTimestamp.Time.Format(time.RFC1123Z),
|
||||
event.LastTimestamp.Time.Format(time.RFC1123Z),
|
||||
event.Count,
|
||||
event.InvolvedObject.Name,
|
||||
event.InvolvedObject.Kind,
|
||||
event.InvolvedObject.FieldPath,
|
||||
|
Reference in New Issue
Block a user