events

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 15 Imported by: 45

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache

func NewCache() *cache

func NewWatcher

func NewWatcher(name string, mgr manager.Manager, resource client.Object) *watcher

Types

type Cache

type Cache interface {
	// handler that receives events from controller-runtime
	handler.EventHandler

	// retrieve an event from the cache
	Get(key string) eventType

	// remove an event from the cache
	Forget(key string)
}

Cache caches k8s resource events It implements handler.eventHandler, emitting reconcile Requests for its cached events. This allows a Reconciler to claim and process these custom events

type EventHandler

type EventHandler interface {
	Create(object client.Object) error

	Delete(object client.Object) error

	Update(old, new client.Object) error

	Generic(object client.Object) error
}

type EventWatcher

type EventWatcher interface {
	// start a watch with the EventWatcher
	// watches cannot currently be disabled / removed except by
	// terminating the parent controller
	Watch(ctx context.Context, eventHandler EventHandler, predicates ...predicate.Predicate) error
}

an EventWatcher is a controller-runtime reconciler that uses a cache to retrieve the original event that spawned the reconcile request

Jump to

Keyboard shortcuts

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