dynamicwatcher

package
v0.2.1-0...-90e585d Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicWatcher

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

DynamicWatcher is able to dynamically allocate new watches for arbitrary objects. Multiple watches to the same resource, will be de-duplicated.

func New

func New(
	log logr.Logger,
	scheme *runtime.Scheme,
	restMapper meta.RESTMapper,
	client dynamic.Interface,
) *DynamicWatcher

func (*DynamicWatcher) Free

func (dw *DynamicWatcher) Free(owner client.Object) error

Free all watches associated with the given owner.

func (*DynamicWatcher) OwnersForNamespacedGKV

func (dw *DynamicWatcher) OwnersForNamespacedGKV(ngvk namespacedGKV) []OwnerRef

func (*DynamicWatcher) Start

func (dw *DynamicWatcher) Start(
	ctx context.Context,
	handler handler.EventHandler,
	queue workqueue.RateLimitingInterface,
	predicates ...predicate.Predicate,
) error

Starts this event source.

func (*DynamicWatcher) String

func (dw *DynamicWatcher) String() string

func (*DynamicWatcher) Watch

func (dw *DynamicWatcher) Watch(owner client.Object, obj runtime.Object) error

Watch the given object type and associate the watch with the given owner.

type EnqueueWatchingObjects

type EnqueueWatchingObjects struct {
	WatcherRefGetter ownerRefGetter
	// WatcherType is the type of the Owner object to look for in OwnerReferences.  Only Group and Kind are compared.
	WatcherType runtime.Object
	// Whether the registered Watchers are namespace scoped or cluster scoped.
	ClusterScoped bool
	// contains filtered or unexported fields
}

Enqueues all objects watching the object mentioned in the event, filtered by WatcherType.

func (*EnqueueWatchingObjects) Create

func (*EnqueueWatchingObjects) Delete

func (*EnqueueWatchingObjects) Generic

func (*EnqueueWatchingObjects) InjectScheme

func (e *EnqueueWatchingObjects) InjectScheme(s *runtime.Scheme) error

InjectScheme is called by the Controller to provide a singleton scheme to the EnqueueRequestForOwner.

func (*EnqueueWatchingObjects) Update

type OwnerRef

type OwnerRef struct {
	UID       types.UID
	Group     string
	Kind      string
	Name      string
	Namespace string
}

Jump to

Keyboard shortcuts

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