controller

package
v1.13.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEventHandlers

func AddEventHandlers(informer cache.SharedInformer, a addFunc, u updateFunc, d deleteFunc) (cache.ResourceEventHandlerRegistration, error)

func AddEventHandlersT added in v1.8.1

func AddEventHandlersT[T any](informer cache.SharedInformer, a addFuncT[T], u updateFuncT[T], d deleteFuncT[T]) (cache.ResourceEventHandlerRegistration, error)

func AddFunc

func AddFunc(logger logr.Logger, enqueue EnqueueFunc) addFunc

func AddFuncT added in v1.9.0

func AddFuncT[K metav1.Object](logger logr.Logger, enqueue EnqueueFuncT[K]) addFuncT[K]

func CheckLabel added in v1.8.2

func CheckLabel(obj metav1.Object, key, value string) bool

func Cleanup

func Cleanup[T any, R Object[T]](ctx context.Context, actual []R, expected []R, deleter Deleter) error

func CreateOrUpdate

func CreateOrUpdate[T any, R Object[T], G Getter[R], S Setter[R]](ctx context.Context, name string, getter G, setter S, build func(R) error) (R, error)

func DeleteFunc

func DeleteFunc(logger logr.Logger, enqueue EnqueueFunc) deleteFunc

func DeleteFuncT added in v1.9.0

func DeleteFuncT[K metav1.Object](logger logr.Logger, enqueue EnqueueFuncT[K]) deleteFuncT[K]

func ExplicitKey

func ExplicitKey[K any](parseKey func(K) cache.ExplicitKey) keyFunc

func GetAnnotation added in v1.10.5

func GetAnnotation(obj metav1.Object, key string) string

func GetLabel added in v1.10.0

func GetLabel(obj metav1.Object, key string) string

func GetOrNew

func GetOrNew[T any, R Object[T], G Getter[R]](name string, getter G) (R, error)

func HasAnnotation added in v1.9.0

func HasAnnotation(obj metav1.Object, key string) bool

func HasLabel added in v1.8.3

func HasLabel(obj metav1.Object, key string) bool

func IsManagedByKyverno added in v1.9.0

func IsManagedByKyverno(obj metav1.Object) bool

func MetaNamespaceKey

func MetaNamespaceKey(obj interface{}) (interface{}, error)

func MetaNamespaceKeyT added in v1.9.0

func MetaNamespaceKeyT[T any](obj T) (interface{}, error)

func MetaObjectToName added in v1.10.5

func MetaObjectToName(obj metav1.Object) string

func Run

func Run(ctx context.Context, logger logr.Logger, controllerName string, period time.Duration, queue workqueue.TypedRateLimitingInterface[any], n, maxRetries int, r reconcileFunc, routines ...func(context.Context, logr.Logger))

func SelectorNotManagedByKyverno added in v1.9.0

func SelectorNotManagedByKyverno() (labels.Selector, error)

func SetAnnotation

func SetAnnotation(obj metav1.Object, key, value string)

func SetLabel

func SetLabel(obj metav1.Object, key, value string) map[string]string

func SetManagedByKyvernoLabel added in v1.9.0

func SetManagedByKyvernoLabel(obj metav1.Object)

func SetOwner

func SetOwner(obj metav1.Object, apiVersion, kind, name string, uid types.UID)

func Update

func Update[T interface {
	metav1.Object
	DeepCopy[T]
}, S UpdateClient[T]](ctx context.Context, obj T, setter S, build func(T) error,
) (T, error)

func UpdateFunc

func UpdateFunc(logger logr.Logger, enqueue EnqueueFunc) updateFunc

func UpdateFuncT added in v1.9.0

func UpdateFuncT[K metav1.Object](logger logr.Logger, enqueue EnqueueFuncT[K]) updateFuncT[K]

func UpdateStatus added in v1.8.1

func UpdateStatus[T interface {
	metav1.Object
	DeepCopy[T]
}, S ObjectStatusClient[T]](
	ctx context.Context,
	obj T,
	setter S,
	build func(T) error,
	cmp func(T, T) bool,
) error

Types

type CreateClient added in v1.8.1

type CreateClient[T metav1.Object] interface {
	Create(context.Context, T, metav1.CreateOptions) (T, error)
}

type DeepCopy added in v1.8.1

type DeepCopy[T any] interface {
	DeepCopy() T
}

type DeleteClient added in v1.8.1

type DeleteClient interface {
	Delete(context.Context, string, metav1.DeleteOptions) error
}

type DeleteCollectionClient added in v1.8.1

type DeleteCollectionClient interface {
	DeleteCollection(context.Context, metav1.DeleteOptions, metav1.ListOptions) error
}

type Deleter

type Deleter interface {
	Delete(context.Context, string, metav1.DeleteOptions) error
}

type EnqueueFunc

type EnqueueFunc = EnqueueFuncT[interface{}]

func AddDelayedDefaultEventHandlers

func AddDelayedDefaultEventHandlers(logger logr.Logger, informer cache.SharedInformer, queue workqueue.TypedRateLimitingInterface[any], delay time.Duration) (EnqueueFunc, cache.ResourceEventHandlerRegistration, error)

func AddDelayedExplicitEventHandlers

func AddDelayedExplicitEventHandlers[K any](logger logr.Logger, informer cache.SharedInformer, queue workqueue.TypedRateLimitingInterface[any], delay time.Duration, parseKey func(K) cache.ExplicitKey) (EnqueueFunc, cache.ResourceEventHandlerRegistration, error)

func AddDelayedKeyedEventHandlers

func AddDelayedKeyedEventHandlers(logger logr.Logger, informer cache.SharedInformer, queue workqueue.TypedRateLimitingInterface[any], delay time.Duration, parseKey keyFunc) (EnqueueFunc, cache.ResourceEventHandlerRegistration, error)

func AddExplicitEventHandlers

func AddExplicitEventHandlers[K any](logger logr.Logger, informer cache.SharedInformer, queue workqueue.TypedRateLimitingInterface[any], parseKey func(K) cache.ExplicitKey) (EnqueueFunc, cache.ResourceEventHandlerRegistration, error)

func AddKeyedEventHandlers

func AddKeyedEventHandlers(logger logr.Logger, informer cache.SharedInformer, queue workqueue.TypedRateLimitingInterface[any], parseKey keyFunc) (EnqueueFunc, cache.ResourceEventHandlerRegistration, error)

func Queue

func Queue(queue workqueue.TypedRateLimitingInterface[any]) EnqueueFunc

func QueueAfter

func QueueAfter(queue workqueue.TypedRateLimitingInterface[any], delay time.Duration) EnqueueFunc

type EnqueueFuncT added in v1.8.1

type EnqueueFuncT[T any] func(T) error

func AddDefaultEventHandlersT added in v1.9.0

func AddDefaultEventHandlersT[K metav1.Object](logger logr.Logger, informer cache.SharedInformer, queue workqueue.TypedRateLimitingInterface[any]) (EnqueueFuncT[K], cache.ResourceEventHandlerRegistration, error)

func AddKeyedEventHandlersT added in v1.9.0

func AddKeyedEventHandlersT[K metav1.Object](logger logr.Logger, informer cache.SharedInformer, queue workqueue.TypedRateLimitingInterface[any], parseKey keyFuncT[K, interface{}]) (EnqueueFuncT[K], cache.ResourceEventHandlerRegistration, error)

func LogError

func LogError[K any](logger logr.Logger, inner EnqueueFuncT[K]) EnqueueFuncT[K]

func Parse

func Parse[K, L any](parseKey keyFuncT[K, L], inner EnqueueFuncT[L]) EnqueueFuncT[K]

type GetClient added in v1.8.1

type GetClient[T metav1.Object] interface {
	Get(context.Context, string, metav1.GetOptions) (T, error)
}

type Getter

type Getter[T any] interface {
	Get(string) (T, error)
}

type ListClient added in v1.8.1

type ListClient[T any] interface {
	List(context.Context, metav1.ListOptions) (T, error)
}

type Object

type Object[T any] interface {
	*T
	metav1.Object
	DeepCopy() *T
}

type ObjectClient added in v1.8.1

type ObjectListClient added in v1.8.1

type ObjectListClient[T metav1.Object, L any] interface {
	ObjectClient[T]
	ListClient[L]
}

type ObjectListStatusClient added in v1.8.1

type ObjectListStatusClient[T metav1.Object, L any] interface {
	ObjectClient[T]
	ListClient[L]
	StatusClient[T]
}

type ObjectStatusClient added in v1.8.1

type ObjectStatusClient[T metav1.Object] interface {
	ObjectClient[T]
	StatusClient[T]
}

type PatchClient added in v1.8.1

type PatchClient[T metav1.Object] interface {
	Patch(context.Context, string, types.PatchType, []byte, metav1.PatchOptions, ...string) (T, error)
}

type Setter

type Setter[T any] interface {
	Create(context.Context, T, metav1.CreateOptions) (T, error)
	Update(context.Context, T, metav1.UpdateOptions) (T, error)
}

type StatusClient added in v1.8.1

type StatusClient[T metav1.Object] interface {
	UpdateStatus(context.Context, T, metav1.UpdateOptions) (T, error)
}

type UpdateClient added in v1.8.1

type UpdateClient[T metav1.Object] interface {
	Update(context.Context, T, metav1.UpdateOptions) (T, error)
}

type WatchClient added in v1.8.1

type WatchClient interface {
	Watch(context.Context, metav1.ListOptions) (watch.Interface, error)
}

Jump to

Keyboard shortcuts

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