event

package
v0.39.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRecorder

func NewRecorder(event typedcorev1.EventInterface) (record.EventRecorder, error)

NewRecorder returns an EventRecorder type that can be used to post Events to different object's lifecycles. The returned recorder includes nil checks to prevent panics from invalid objects.

Types

type SafeEventRecorder added in v0.39.0

type SafeEventRecorder struct {
	// contains filtered or unexported fields
}

SafeEventRecorder wraps record.EventRecorder with nil checks to prevent panics when recording events for objects with nil or invalid metadata.

func (*SafeEventRecorder) AnnotatedEventf added in v0.39.0

func (s *SafeEventRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{})

AnnotatedEventf records a formatted event with annotations for the given object, with nil checks.

func (*SafeEventRecorder) Event added in v0.39.0

func (s *SafeEventRecorder) Event(object runtime.Object, eventtype, reason, message string)

Event records an event for the given object, with nil checks.

func (*SafeEventRecorder) Eventf added in v0.39.0

func (s *SafeEventRecorder) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{})

Eventf records a formatted event for the given object, with nil checks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL