controller

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(obj client.Object, finalizer string) bool

AddFinalizer adds the given finalizer to the given object.

func HasFinalizer

func HasFinalizer(o client.Object, finalizer string) bool

HasFinalizer returns true if the given object has the given finalizer.

func IsBeingDeleted

func IsBeingDeleted(obj client.Object) bool

IsBeingDeleted returns whether this object has been requested to be deleted.

func NewRequestId

func NewRequestId() string

NewRequestId returns random generated UUID.

func NewRequestLog

func NewRequestLog(log log.Logger, req ctrl.Request, reqID string) log.Logger

NewRequestLog returns a new log.Logger with reconcile.Request's metadata.

func NoRequeue

func NoRequeue() (ctrl.Result, error)

func RemoveFinalizer

func RemoveFinalizer(obj client.Object, finalizer string) bool

RemoveFinalizer removes the given finalizer from the given object.

func Requeue

func Requeue(requeue bool) (ctrl.Result, error)

func RequeueAfter

func RequeueAfter(interval time.Duration) (ctrl.Result, error)

func RequeueAfterError

func RequeueAfterError(interval time.Duration, err error) (ctrl.Result, error)

func RequeueError

func RequeueError(err error) (ctrl.Result, error)

func RequeueImmediately

func RequeueImmediately() (ctrl.Result, error)

Types

type RequestContext

type RequestContext interface {
	context.Context

	// GetRequestId returns the request ID.
	GetRequestId() string
	// GetRequest returns the underlying request.
	GetRequest() ctrl.Request
	// GetLogger returns an initialized logger.
	GetLogger() log.Logger
	// Cancel cancels the request context and tells the reconciler to abandon its work.
	Cancel()
	// Canceled returns true whether the request context has been canceled.
	Canceled() bool
}

RequestContext is an interface and serves as a base for contexts.

func NewRequestContext

func NewRequestContext(ctx context.Context, req ctrl.Request,
	reqID string, reqLogger log.Logger) RequestContext

NewRequestContext returns a new request context.

Jump to

Keyboard shortcuts

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