controller-runtimesigs.k8s.io/controller-runtime/pkg/internal/recorder Index | Files

package recorder

import "sigs.k8s.io/controller-runtime/pkg/internal/recorder"

Index

Types

type EventBroadcasterProducer

type EventBroadcasterProducer func() (caster record.EventBroadcaster, stopWithProvider bool)

EventBroadcasterProducer makes an event broadcaster, returning whether or not the broadcaster should be stopped with the Provider, or not (e.g. if it's shared, it shouldn't be stopped with the Provider).

type Provider

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

Provider is a recorder.Provider that records events to the k8s API server and to a logr Logger.

func NewProvider

func NewProvider(config *rest.Config, httpClient *http.Client, scheme *runtime.Scheme, logger logr.Logger, makeBroadcaster EventBroadcasterProducer) (*Provider, error)

NewProvider create a new Provider instance.

func (*Provider) GetEventRecorderFor

func (p *Provider) GetEventRecorderFor(name string) record.EventRecorder

GetEventRecorderFor returns an event recorder that broadcasts to this provider's broadcaster. All events will be associated with a component of the given name.

func (*Provider) Stop

func (p *Provider) Stop(shutdownCtx context.Context)

Stop attempts to stop this provider, stopping the underlying broadcaster if the broadcaster asked to be stopped. It kinda tries to honor the given context, but the underlying broadcaster has an indefinite wait that doesn't return until all queued events are flushed, so this may end up just returning before the underlying wait has finished instead of cancelling the wait. This is Very Frustrating™.

Source Files

recorder.go

Version
v0.20.4 (latest)
Published
Mar 24, 2025
Platform
linux/amd64
Imports
10 packages
Last checked
2 days ago

Tools for package owners.