basereconciler

package
v0.15.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendedObjectList

type ExtendedObjectList interface {
	client.ObjectList
	GetItem(int) client.Object
	CountItems() int
}

ExtendedObjectList is an extension of client.ObjectList with methods to manipulate generically the objects in the list

type Reconciler

type Reconciler struct {
	lockedresourcecontroller.EnforcingReconciler
}

Reconciler computes a list of resources that it needs to keep in place

func NewFromManager

func NewFromManager(mgr manager.Manager, recorderName string, clusterWatchers bool) Reconciler

NewFromManager constructs a new Reconciler from the given manager

func (*Reconciler) GetInstance

func (r *Reconciler) GetInstance(ctx context.Context, key types.NamespacedName,
	instance client.Object, finalizer string, cleanupFns []func(), log logr.Logger) (*ctrl.Result, error)

GetInstance tries to retrieve the custom resource instance and perform some standard tasks like initialization and cleanup when required.

func (*Reconciler) IsInitialized

func (r *Reconciler) IsInitialized(instance client.Object, finalizer string) bool

IsInitialized can be used to check if instance is correctly initialized. Returns false if it isn't.

func (*Reconciler) ManageCleanUpLogic

func (r *Reconciler) ManageCleanUpLogic(instance client.Object, fns []func(), log logr.Logger) error

ManageCleanUpLogic contains finalization logic for the LockedResourcesReconciler Functionality can be extended by passing extra cleanup functions

func (*Reconciler) ReconcileOwnedResources

func (r *Reconciler) ReconcileOwnedResources(ctx context.Context, owner client.Object, resources []Resource) error

ReconcileOwnedResources handles generalized resource reconcile logic for all controllers

func (*Reconciler) SecretEventHandler

func (r *Reconciler) SecretEventHandler(ol ExtendedObjectList, logger logr.Logger) handler.EventHandler

SecretEventHandler returns an EventHandler for the specific ExtendedObjectList list object passed as parameter

type Resource

type Resource interface {
	Build(ctx context.Context, cl client.Client) (client.Object, []string, error)
	Enabled() bool
}

type ResourceWithCustomReconciler added in v0.15.0

type ResourceWithCustomReconciler interface {
	Resource
	ResourceReconciler(context.Context, client.Client, client.Object) error
}

Directories

Path Synopsis
api/v1alpha1
Package v1alpha1 is a test API definition +kubebuilder:object:generate=true +groupName=example.com
Package v1alpha1 is a test API definition +kubebuilder:object:generate=true +groupName=example.com

Jump to

Keyboard shortcuts

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