reconcile_v2

package
v0.23.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoop

func NewLoop[T client.Object](
	name, cluster string,
	mgr manager.Manager,
	options Options,
) *runner[T]

Types

type DeletionReconciler

type DeletionReconciler interface {
	// we received a reconcile request for an object that was removed from the cache
	// requeue the object if returning an error
	ReconcileDeletion(ctx context.Context, request Request) error
}

type FinalizingReconciler

type FinalizingReconciler[T client.Object] interface {
	Reconciler[T]

	// name of the finalizer used by this handler.
	// finalizer names should be unique for a single task
	FinalizerName() string

	// finalize the object before it is deleted.
	// Watchers created with a finalizing handler will a
	Finalize(ctx context.Context, object T) error
}

type Loop

type Loop[T client.Object] interface {
	RunReconciler(ctx context.Context, reconciler Reconciler[T], predicates ...predicate.Predicate) error
}

a Reconcile Loop runs resource reconcilers until the context gets cancelled

type Options

type Options struct {
	// If true will wait for cache sync before returning from RunReconcile
	WaitForCacheSync bool

	// If provided, attempt to verify the resource before beginning the reconcile loop
	Verifier verifier.ServerResourceVerifier
}

type ReconcileFuncs

type ReconcileFuncs[T client.Object] struct {
	ReconcileFunc          func(ctx context.Context, object T) (Result, error)
	DeletionReconcilerFunc func(ctx context.Context, request Request) error
}

func (*ReconcileFuncs[T]) DeletionReconciler

func (r *ReconcileFuncs[T]) DeletionReconciler(ctx context.Context, request Request) error

func (*ReconcileFuncs[T]) Reconcile

func (r *ReconcileFuncs[T]) Reconcile(ctx context.Context, object T) (Result, error)

type Reconciler

type Reconciler[T client.Object] interface {
	// reconcile an object
	// requeue the object if returning an error, or a non-zero "requeue-after" duration
	Reconcile(ctx context.Context, object T) (Result, error)
}

type Request

type Request = reconcile.Request

type Result

type Result = reconcile.Result

Jump to

Keyboard shortcuts

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