eventemitter

package
v0.6.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package eventemitter publishes Kubernetes Events for rendered configuration, deployment failures, and rejected watched inputs. Only the leader emits.

Index

Constants

View Source
const (
	// ComponentName is the unique identifier for this component.
	ComponentName = "event-emitter"

	// EventBufferSize is the size of the event subscription buffer.
	EventBufferSize = busevents.StandardSubscriberBuffer
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	*component.Base
	// contains filtered or unexported fields
}

Component forwards controller notifications to Kubernetes Events.

func New

func New(cfg *Config) *Component

New creates the event emitter. It subscribes during construction (before EventBus.Start()) via the shared component.Base scaffold.

func (*Component) HandleEvent

func (c *Component) HandleEvent(event busevents.Event)

HandleEvent implements component.EventHandler.

func (*Component) Start

func (c *Component) Start(ctx context.Context) error

Start runs the embedded component.Base event loop. The broadcaster/recorder are built lazily on the first BecameLeaderEvent (ensureRecorder), so a replica that is only ever a follower never spawns a broadcaster goroutine or an API-server Event sink connection — only the leader (which actually emits) pays for them.

type Config

type Config struct {
	EventBus   *busevents.EventBus
	KubeClient kubernetes.Interface
	Logger     *slog.Logger
}

Config wires the component's dependencies.

Jump to

Keyboard shortcuts

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