reconciler

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ObserveControllerSyncError

func ObserveControllerSyncError(name string, kind string)

func ObserveRetriesExceeded

func ObserveRetriesExceeded(name string)

func ObserveWorkerEnd

func ObserveWorkerEnd(name string, duration time.Duration)

func ObserveWorkerStart

func ObserveWorkerStart(name string)

func ObserveWorkersTotal

func ObserveWorkersTotal(name string, concurrency int)

Types

type Controller

type Controller struct {

	// SplitMetaNamespaceKey is the function used to split a key into namespace and name.
	// Defaults to cache.SplitMetaNamespaceKey.
	SplitMetaNamespaceKey func(string) (string, string, error)
	// contains filtered or unexported fields
}

Controller is a reconciler controller template that handles concurrency, workqueue and retries with a Reconciler handler.

func NewController

func NewController(handler Reconciler, queue workqueue.RateLimitingInterface) *Controller

NewController creates a Controller that uses the given Reconciler to handle syncs from a rate-limited workqueue.

func (*Controller) Start

func (w *Controller) Start(ctx context.Context)

func (*Controller) Wait

func (w *Controller) Wait()

Wait until all reconciler workers have exited. They should exit once they are done with their work, and a Get from the workqueue is telling them to shut down.

type Reconciler

type Reconciler interface {
	Name() string
	Concurrency() int
	MaxRequeues() int
	SyncOne(ctx context.Context, namespace, name string, numRequeues int) error
}

Reconciler is implemented by reconciliation-based controllers.

Jump to

Keyboard shortcuts

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