usage

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package usage manages the lifecycle of usageResource objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RespectOwnerRefs

func RespectOwnerRefs() xpresource.ApplyOption

RespectOwnerRefs is an ApplyOption that ensures the existing owner references of the current Usage are respected. We need this option to be consumed in the composite controller since otherwise we lose the owner reference this controller puts on the Usage.

func Setup

Setup adds a controller that reconciles Usages by defining a composite resource and starting a controller to reconcile it.

Types

type Reconciler

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

A Reconciler reconciles Usages.

func NewReconciler

func NewReconciler(mgr manager.Manager, opts ...ReconcilerOption) *Reconciler

NewReconciler returns a Reconciler of Usages.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)

Reconcile a Usage resource by resolving its selectors, defining ownership relationship, adding a finalizer and handling proper deletion.

type ReconcilerOption

type ReconcilerOption func(*Reconciler)

ReconcilerOption is used to configure the Reconciler.

func WithClientApplicator

func WithClientApplicator(c xpresource.ClientApplicator) ReconcilerOption

WithClientApplicator specifies how the Reconciler should interact with the Kubernetes API.

func WithFinalizer

func WithFinalizer(f xpresource.Finalizer) ReconcilerOption

WithFinalizer specifies how the Reconciler should add and remove finalizers to and from the managed resource.

func WithLogger

func WithLogger(log logging.Logger) ReconcilerOption

WithLogger specifies how the Reconciler should log messages.

func WithPollInterval

func WithPollInterval(after time.Duration) ReconcilerOption

WithPollInterval specifies how long the Reconciler should wait before queueing a new reconciliation after a successful reconcile. The Reconciler requeues after a specified duration when it is not actively waiting for an external operation, but wishes to check whether resources it does not have a watch on (i.e. used/using resources) need to be reconciled.

func WithRecorder

func WithRecorder(er event.Recorder) ReconcilerOption

WithRecorder specifies how the Reconciler should record Kubernetes events.

func WithSelectorResolver

func WithSelectorResolver(sr selectorResolver) ReconcilerOption

WithSelectorResolver specifies how the Reconciler should resolve any resource references it encounters while reconciling Usages.

Jump to

Keyboard shortcuts

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