controllerutils

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateWithController

func CreateOrUpdateWithController[T client.Object](ctx context.Context, client client.Client, scheme *runtime.Scheme,
	key types.NamespacedName, owner client.Object, mutate func(t T) error) (T, controllerutil.OperationResult, error)

func DefaultLiveness

func DefaultLiveness() *corev1.Probe

func IsDeleted

func IsDeleted(meta client.Object) bool

func Requeue

func Requeue(after ...time.Duration) *controllerruntime.Result

Types

type Finalizer

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

func New

func New(name string) *Finalizer

func (*Finalizer) Add

func (f *Finalizer) Add(ctx context.Context, client client.Client, object client.Object) error

func (*Finalizer) AssertIsInstalled

func (f *Finalizer) AssertIsInstalled(ctx context.Context, client client.Client, ob client.Object) error

func (*Finalizer) Handle

func (f *Finalizer) Handle(ctx context.Context, client client.Client, ob client.Object, fn func() error) (bool, error)

func (*Finalizer) IsPresent

func (f *Finalizer) IsPresent(ob client.Object) bool

func (*Finalizer) Remove

func (f *Finalizer) Remove(ctx context.Context, client client.Client, object client.Object) error

type Mutator

type Mutator[T apisv1beta1.Object] interface {
	SetupWithBuilder(mgr ctrl.Manager, builder *ctrl.Builder) error
	Mutate(ctx context.Context, t T) (*ctrl.Result, error)
}

type Reconciler

type Reconciler[T apisv1beta1.Object] struct {
	client.Client
	Scheme  *runtime.Scheme
	Mutator Mutator[T]
}

Reconciler reconciles a Stack object

func NewReconciler

func NewReconciler[T apisv1beta1.Object](client client.Client, scheme *runtime.Scheme, mutator Mutator[T]) *Reconciler[T]

func (*Reconciler[T]) Reconcile

func (r *Reconciler[T]) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*Reconciler[T]) SetupWithManager

func (r *Reconciler[T]) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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