queueinformer

package
v0.10.1-1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoopID

func NewLoopID() string

Types

type Operator

type Operator struct {
	OpClient operatorclient.ClientInterface
	Log      *logrus.Logger
	// contains filtered or unexported fields
}

An Operator is a collection of QueueInformers OpClient is used to establish the connection to kubernetes

func NewOperator

func NewOperator(kubeconfig string, logger *logrus.Logger, queueInformers ...*QueueInformer) (*Operator, error)

NewOperator creates a new Operator configured to manage the cluster defined in kubeconfig.

func NewOperatorFromClient

func NewOperatorFromClient(opClient operatorclient.ClientInterface, logger *logrus.Logger, queueInformers ...*QueueInformer) (*Operator, error)

func (*Operator) RegisterInformer

func (o *Operator) RegisterInformer(informer cache.SharedIndexInformer)

RegisterInformer adds an Informer to this operator

func (*Operator) RegisterQueueIndexer

func (o *Operator) RegisterQueueIndexer(indexer *QueueIndexer)

RegisterQueueIndexer adds a QueueIndexer to this operator

func (*Operator) RegisterQueueInformer

func (o *Operator) RegisterQueueInformer(queueInformer *QueueInformer)

RegisterQueueInformer adds a QueueInformer to this operator

func (*Operator) Run

func (o *Operator) Run(stopc <-chan struct{}) (ready, done chan struct{}, atLevel chan error)

Run starts the operator's control loops

type QueueIndexer

type QueueIndexer struct {
	metrics.MetricsProvider
	// contains filtered or unexported fields
}

QueueIndexer ties an indexer to a queue in order to process events the syncHandler is called for all objects on the queue Unlike QueueInformer, nothing is automatically adding objects to the queue

func NewQueueIndexer

func NewQueueIndexer(queue workqueue.RateLimitingInterface, indexers map[string]cache.Indexer, handler SyncHandler, name string, logger *logrus.Logger, provider metrics.MetricsProvider) *QueueIndexer

func (*QueueIndexer) Add

func (q *QueueIndexer) Add(key string)

func (*QueueIndexer) Enqueue

func (q *QueueIndexer) Enqueue(obj interface{})

Enqueue adds a key to the queue. If obj is a key already it gets added directly. Otherwise, the key is extracted via keyFunc.

type QueueInformer

type QueueInformer struct {
	metrics.MetricsProvider
	// contains filtered or unexported fields
}

QueueInformer ties an informer to a queue in order to process events from the informer the informer watches objects of interest and adds objects to the queue for processing the syncHandler is called for all objects on the queue

func New

New creates a set of new queueinformers given a name, a set of informers, and a sync handler to handle the objects that the operator is managing. Optionally, custom event handler funcs can be passed in (defaults will be provided)

func NewInformer

NewInformer creates a new queueinformer given a name, an informer, and a sync handler to handle the objects that the operator is managing. Optionally, custom event handler funcs can be passed in (defaults will be provided)

type ResourceQueueSet

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

ResourceQueueSet is a set of workqueues that is assumed to be keyed by namespace

func NewEmptyResourceQueueSet

func NewEmptyResourceQueueSet() *ResourceQueueSet

NewEmptyResourceQueueSet returns a new queue set with an empty but initialized queue map

func NewResourceQueueSet

func NewResourceQueueSet(queueSet map[string]workqueue.RateLimitingInterface) *ResourceQueueSet

NewResourceQueueSet returns a new queue set with the given queue map

func (*ResourceQueueSet) Remove

func (r *ResourceQueueSet) Remove(name, namespace string) error

Remove removes the resource in the set with the given name and namespace

func (*ResourceQueueSet) Requeue

func (r *ResourceQueueSet) Requeue(name, namespace string) error

Requeue requeues the resource in the set with the given name and namespace

func (*ResourceQueueSet) RequeueByKey

func (r *ResourceQueueSet) RequeueByKey(key string) error

RequeueByKey adds the given key to the resource queue that should contain it

func (*ResourceQueueSet) Set

Set sets the queue at the given key

type SyncHandler

type SyncHandler func(obj interface{}) error

SyncHandler is the function that reconciles the controlled object when seen

Jump to

Keyboard shortcuts

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