Documentation ¶
Index ¶
- Constants
- type Event
- type Recorder
- func (r *Recorder) EventErrorf(object corev1.ObjectReference, metadata map[string]string, reason string, ...) error
- func (r *Recorder) EventInfof(object corev1.ObjectReference, metadata map[string]string, reason string, ...) error
- func (r *Recorder) Eventf(object corev1.ObjectReference, metadata map[string]string, ...) error
Constants ¶
View Source
const ( // Information only and will not cause any problems. EventSeverityInfo string = "info" // These events are to warn that something might go wrong. EventSeverityError string = "error" )
Valid values for event severity.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { // The object that this event is about. // +required InvolvedObject corev1.ObjectReference `json:"involvedObject"` // Severity type of this event (info, error) // +required Severity string `json:"severity"` // The time at which this event was recorded. // +required Timestamp metav1.Time `json:"timestamp"` // A human-readable description of this event. // Maximum length 39,000 characters // +required Message string `json:"message"` // A machine understandable string that gives the reason // for the transition into the object's current status. // +required Reason string `json:"reason"` // Metadata of this event, e.g. apply change set. // +optional Metadata map[string]string `json:"metadata,omitempty"` // Name of the controller that emitted this event, e.g. `source-controller`. // +required ReportingController string `json:"reportingController"` // ID of the controller instance, e.g. `source-controller-xyzf`. // +optional ReportingInstance string `json:"reportingInstance,omitempty"` }
Event is a report of an event issued by a controller.
type Recorder ¶
type Recorder struct { // URL address of the events endpoint. Webhook string // Name of the controller that emits events. ReportingController string // Retryable HTTP client Client *retryablehttp.Client }
Recorder posts events to the webhook address.
func NewRecorder ¶
NewRecorder creates an event Recorder with default settings. The recorder performs automatic retries for connection errors and 500-range response code.
func (*Recorder) EventErrorf ¶
func (r *Recorder) EventErrorf( object corev1.ObjectReference, metadata map[string]string, reason string, messageFmt string, args ...interface{}) error
EventErrorf records an event with error severity.
func (*Recorder) EventInfof ¶
func (r *Recorder) EventInfof( object corev1.ObjectReference, metadata map[string]string, reason string, messageFmt string, args ...interface{}) error
EventInfof records an event with information severity.
Click to show internal directories.
Click to hide internal directories.