You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Kubernetes core has the following record.EventRecorder interface:
// EventRecorder knows how to record events on behalf of an EventSource.typeEventRecorderinterface {
// Event constructs an event from the given information and puts it in the queue for sending.// 'object' is the object this event is about. Event will make a reference-- or you may also// pass a reference to the object directly.// 'type' of this event, and can be one of Normal, Warning. New types could be added in future// 'reason' is the reason this event is generated. 'reason' should be short and unique; it// should be in UpperCamelCase format (starting with a capital letter). "reason" will be used// to automate handling of events, so imagine people writing switch statements to handle them.// You want to make that easy.// 'message' is intended to be human readable.//// The resulting event will be created in the same namespace as the reference object.Event(object runtime.Object, eventtype, reason, messagestring)
// Eventf is just like Event, but with Sprintf for the message field.Eventf(object runtime.Object, eventtype, reason, messageFmtstring, args...interface{})
// AnnotatedEventf is just like eventf, but with annotations attachedAnnotatedEventf(object runtime.Object, annotationsmap[string]string, eventtype, reason, messageFmtstring, args...interface{})
}
As this interface includes everything we need, including adding "metadata" using AnnotatedEventf, it would likely be better if our own event.Recorder would adhere to the above interface.
As a second step, the controllers.Events helper could be refactored into a "DelegatingRecorder" which delegates events to all underlying recorder implementations.
The text was updated successfully, but these errors were encountered:
The Kubernetes core has the following
record.EventRecorder
interface:As this interface includes everything we need, including adding "metadata" using
AnnotatedEventf
, it would likely be better if our ownevent.Recorder
would adhere to the above interface.As a second step, the
controllers.Events
helper could be refactored into a "DelegatingRecorder
" which delegates events to all underlying recorder implementations.The text was updated successfully, but these errors were encountered: