internal

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler[T client.Object] struct {
	// contains filtered or unexported fields
}

EventHandler adapts a handler.EventHandler interface to a cache.ResourceEventHandler interface.

func NewEventHandler

func NewEventHandler[T client.Object](ctx context.Context, queue workqueue.RateLimitingInterface, handler handler.TypedEventHandler[T], predicates []predicate.TypedPredicate[T]) *EventHandler[T]

NewEventHandler creates a new EventHandler.

func (*EventHandler[T]) HandlerFuncs

func (e *EventHandler[T]) HandlerFuncs() cache.ResourceEventHandlerFuncs

HandlerFuncs converts EventHandler to a ResourceEventHandlerFuncs TODO: switch to ResourceEventHandlerDetailedFuncs with client-go 1.27

func (*EventHandler[T]) OnAdd

func (e *EventHandler[T]) OnAdd(obj interface{})

OnAdd creates CreateEvent and calls Create on EventHandler.

func (*EventHandler[T]) OnDelete

func (e *EventHandler[T]) OnDelete(obj interface{})

OnDelete creates DeleteEvent and calls Delete on EventHandler.

func (*EventHandler[T]) OnUpdate

func (e *EventHandler[T]) OnUpdate(oldObj, newObj interface{})

OnUpdate creates UpdateEvent and calls Update on EventHandler.

type Kind

type Kind[T client.Object] struct {
	// Type is the type of object to watch.  e.g. &v1.Pod{}
	Type T

	// Cache used to watch APIs
	Cache cache.Cache

	Handler handler.TypedEventHandler[T]

	Predicates []predicate.TypedPredicate[T]
	// contains filtered or unexported fields
}

Kind is used to provide a source of events originating inside the cluster from Watches (e.g. Pod Create).

func (*Kind[T]) Start

func (ks *Kind[T]) Start(ctx context.Context, queue workqueue.RateLimitingInterface) error

Start is internal and should be called only by the Controller to register an EventHandler with the Informer to enqueue reconcile.Requests.

func (*Kind[T]) String

func (ks *Kind[T]) String() string

func (*Kind[T]) WaitForSync

func (ks *Kind[T]) WaitForSync(ctx context.Context) error

WaitForSync implements SyncingSource to allow controllers to wait with starting workers until the cache is synced.

Jump to

Keyboard shortcuts

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