controllerutil

package
v0.0.0-...-256c802 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetOwner

func SetOwner(obj runtime.Object, owner runtime.Object, scheme *runtime.Scheme)

func WrapRetryError

func WrapRetryError(err error) error

Types

type Controller

type Controller interface {
	ObjectToKeys(obj interface{}) []string
	GetObject(key string) (runtime.Object, error)
	UpdateObject(ctx context.Context, obj runtime.Object) (runtime.Object, error)
	Reconcile(ctx context.Context, obj runtime.Object) error
	Finalize(ctx context.Context, obj runtime.Object) error
}

type ControllerBase

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

func NewBase

func NewBase(
	name string,
	v Controller,
	coreClient kubernetes.Interface,
	eventSource []cache.SharedIndexInformer,
	informers []cache.SharedIndexInformer,
	finalizers []string,
) *ControllerBase

func (*ControllerBase) EventRecorder

func (b *ControllerBase) EventRecorder() record.EventRecorder

func (*ControllerBase) Log

func (b *ControllerBase) Log() *zap.Logger

func (*ControllerBase) Shutdown

func (b *ControllerBase) Shutdown()

func (*ControllerBase) StartWorkers

func (b *ControllerBase) StartWorkers(ctx context.Context, workers int)

func (*ControllerBase) WaitForSync

func (b *ControllerBase) WaitForSync(ctx context.Context) bool

type GenericControllerBase

type GenericControllerBase[T runtime.Object] struct {
	// contains filtered or unexported fields
}

func NewGenericControllerBase

func NewGenericControllerBase[T runtime.Object](
	name string,
	newReconciler func() GenericReconciler[T],
	coreClient kubernetes.Interface,
	eventSource []cache.SharedIndexInformer,
	informers []cache.SharedIndexInformer,
	finalizers []string,
	getObjectFn func(namespace, name string) (T, error),
	updateObjectFn func(context.Context, T, metav1.UpdateOptions) (T, error),
) *GenericControllerBase[T]

func (*GenericControllerBase[T]) EventRecorder

func (b *GenericControllerBase[T]) EventRecorder() record.EventRecorder

func (*GenericControllerBase[T]) Log

func (b *GenericControllerBase[T]) Log() *zap.Logger

func (*GenericControllerBase[T]) Shutdown

func (b *GenericControllerBase[T]) Shutdown()

func (*GenericControllerBase[T]) StartWorkers

func (b *GenericControllerBase[T]) StartWorkers(ctx context.Context, workers int)

func (*GenericControllerBase[T]) WaitForSync

func (b *GenericControllerBase[T]) WaitForSync(ctx context.Context) bool

type GenericReconciler

type GenericReconciler[T runtime.Object] interface {
	Reconcile(ctx context.Context, obj T) error
	Finalize(ctx context.Context, obj T) error
}

type GenericWorkQueue

type GenericWorkQueue[T runtime.Object] struct {
	// contains filtered or unexported fields
}

func NewGenericWorkQueue

func NewGenericWorkQueue[T runtime.Object](name string) *GenericWorkQueue[T]

func (*GenericWorkQueue[T]) Add

func (q *GenericWorkQueue[T]) Add(item T)

func (*GenericWorkQueue[T]) AddRateLimited

func (q *GenericWorkQueue[T]) AddRateLimited(item T)

func (*GenericWorkQueue[T]) Done

func (q *GenericWorkQueue[T]) Done(item T)

func (*GenericWorkQueue[T]) Forget

func (q *GenericWorkQueue[T]) Forget(item T)

func (*GenericWorkQueue[T]) Get

func (q *GenericWorkQueue[T]) Get() <-chan T

func (*GenericWorkQueue[T]) Shutdown

func (q *GenericWorkQueue[T]) Shutdown()

type Reconciler

type Reconciler interface {
	Reconcile(ctx context.Context, obj runtime.Object) error
	Finalize(ctx context.Context, obj runtime.Object) error
}

type RetryError

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

func (*RetryError) Error

func (e *RetryError) Error() string

func (*RetryError) Is

func (e *RetryError) Is(err error) bool

func (*RetryError) Unwrap

func (e *RetryError) Unwrap() error

type WorkQueue

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

func NewWorkQueue

func NewWorkQueue(name string) *WorkQueue

func (*WorkQueue) Add

func (q *WorkQueue) Add(item interface{})

func (*WorkQueue) AddRateLimited

func (q *WorkQueue) AddRateLimited(item interface{})

func (*WorkQueue) Done

func (q *WorkQueue) Done(item interface{})

func (*WorkQueue) Forget

func (q *WorkQueue) Forget(item interface{})

func (*WorkQueue) Get

func (q *WorkQueue) Get() <-chan interface{}

func (*WorkQueue) Shutdown

func (q *WorkQueue) Shutdown()

Jump to

Keyboard shortcuts

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