reconcile

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FinalizerInProgress

func FinalizerInProgress(r *ctrl.Result, err error) bool

func WithFinalizer

func WithFinalizer(client client.Client, ctx Context, obj client.Object, finalizer Finalizer) (*ctrl.Result, error)

Types

type Context

type Context struct {
	CorrelationId string
	Request       ctrl.Request
	Context       context.Context
	Log           logr.Logger
}

Context provides context during reconciles

func NewContext

func NewContext(name string, req ctrl.Request, log logr.Logger) Context

NewContext creates a new context

func (Context) Complete

func (ctx Context) Complete(results ...Result) (ctrl.Result, error)

Complete handles multiple reconcile results and triggers a requeue based on the results

func (Context) Done

func (ctx Context) Done() Result

Done creates a ReconcileResult that will not trigger a requeue

func (Context) Error

func (ctx Context) Error(err error) Result

Error creates a ReconcileResult that will trigger a requeue based on the given error

func (Context) RequeueIn

func (ctx Context) RequeueIn(seconds int, reason string) Result

RequeueIn creates a ReconcileResult that will trigger a requeue in 'n' seconds

type Finalizer

type Finalizer interface {
	Name() string
	Handler() func(Context) Result
}

type GenericFinalizer

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

func NewGenericFinalizer

func NewGenericFinalizer(finalizer string, handler func(Context) Result) GenericFinalizer

func (GenericFinalizer) Handler

func (f GenericFinalizer) Handler() func(Context) Result

func (GenericFinalizer) Name

func (f GenericFinalizer) Name() string

type Result

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

Result gives context about the result of a reconcile operation

func (Result) Error

func (rr Result) Error() bool

Error returns true when the result represents a failed reconcile attempt

func (*Result) RequeueIn

func (rr *Result) RequeueIn(duration time.Duration, reason string)

func (Result) RequiresRequeue

func (rr Result) RequiresRequeue() bool

RequiresRequeue returns true when there was an error or a requeue was requested

func (*Result) Reset

func (rr *Result) Reset()

type ResultList

type ResultList []Result

ResultList contains a list of results

func (ResultList) AllDone

func (rl ResultList) AllDone() bool

AllDone returns true when all result represents a successful and completed reconcile attempt

func (ResultList) AllSuccessful

func (rl ResultList) AllSuccessful() bool

AllSuccessful returns true when all result represents a successful reconcile attempt

Jump to

Keyboard shortcuts

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