Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LevelMap = map[config.EventType]config.Level{ config.NormalEvent: config.Info, config.InfoEvent: config.Info, config.AllEvent: config.Info, config.CreateEvent: config.Success, config.UpdateEvent: config.Info, config.DeleteEvent: config.Error, config.ErrorEvent: config.Error, config.WarningEvent: config.Error, }
LevelMap is a map of event type to Level
Functions ¶
func AnonymizedEventDetailsFrom ¶
AnonymizedEventDetailsFrom returns anonymized data about a given event.
Types ¶
type Action ¶
type Action struct { // Command is the command to be executed, with the api.MessageBotNamePlaceholder prefix. Command string ExecutorBindings []string DisplayName string }
Action describes an automated action for a given event.
type Event ¶
type Event struct { APIVersion string Kind string Title string Name string Namespace string Messages []string Type config.EventType Reason string Level config.Level Cluster string TimeStamp time.Time Count int32 Action string Skip bool `json:",omitempty"` Resource string Recommendations []string Warnings []string // The following fields are ignored when marshalling the event by purpose. // We send the whole Event struct via sink.Elasticsearch integration. // When using ELS dynamic mapping, we should avoid complex, dynamic objects, which could result into type conflicts. ObjectMeta metaV1.ObjectMeta `json:"-"` Object interface{} `json:"-"` }
Event stores data about a given event for Kubernetes object.
func New ¶
func New(objectMeta metaV1.ObjectMeta, object interface{}, eventType config.EventType, resource string) (Event, error)
New extract required details from k8s object and returns new Event object
func (*Event) HasRecommendationsOrWarnings ¶
HasRecommendationsOrWarnings returns true if event has recommendations or warnings.
Click to show internal directories.
Click to hide internal directories.