This commit adds type information to events.

This addresses issue #15624.
This commit is contained in:
Avesh Agarwal
2015-11-13 17:30:01 -05:00
parent 751e7ba67c
commit 3d5207fd73
29 changed files with 166 additions and 120 deletions

View File

@@ -1781,6 +1781,14 @@ type EventSource struct {
Host string `json:"host,omitempty"`
}
// Valid values for event types (new types could be added in future)
const (
// Information only and will not cause any problems
EventTypeNormal string = "Normal"
// These events are to warn that something might go wrong
EventTypeWarning string = "Warning"
)
// Event is a report of an event somewhere in the cluster.
// TODO: Decide whether to store these separately or with the object they apply to.
type Event struct {
@@ -1811,6 +1819,9 @@ type Event struct {
// The number of times this event has occurred.
Count int `json:"count,omitempty"`
// Type of this event (Normal, Warning), new types could be added in the future.
Type string `json:"type,omitempty"`
}
// EventList is a list of events.