source

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Informer

type Informer struct {
	// Informer is the controller-runtime Informer
	Informer cache.SharedIndexInformer
}

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

func (*Informer) Start

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

func (*Informer) String

func (is *Informer) String() string

type Kind

type Kind struct {
	// Type is the type of object to watch.  e.g. &v1.Pod{}
	Type client.Object
	// 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) Start

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

func (*Kind) String

func (ks *Kind) String() string

func (*Kind) WaitForSync

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

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

type Source

type Source interface {
	// Start is internal and should be called only by the Controller to register an EventHandler with the Informer
	// to enqueue reconcile.Requests.
	Start(context.Context, handler.EventHandler, workqueue.RateLimitingInterface, ...predicate.Predicate) error
}

Source is a source of events (eh.g. Create, Update, Delete operations on Kubernetes Objects, Webhook callbacks, etc) which should be processed by event.EventHandlers to enqueue reconcile.Requests.

* Use Kind for events originating in the cluster (e.g. Pod Create, Pod Update, Deployment Update).

* Use Channel for events originating outside the cluster (eh.g. GitHub Webhook callback, Polling external urls).

Users may build their own Source implementations. If their implementations implement any of the inject package interfaces, the dependencies will be injected by the Controller when Watch is called.

type SyncingSource

type SyncingSource interface {
	Source
	WaitForSync(ctx context.Context) error
}

SyncingSource is a source that needs syncing prior to being usable. The controller will call its WaitForSync prior to starting workers.

func NewKindWithCache

func NewKindWithCache(object client.Object, cache informers.InformerCache) SyncingSource

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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