reconciler

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(manager ctrl.Manager, reconcilers ...Reconciler) error

Configure let the added reconcilers to configure themselves

Types

type Context

type Context interface {

	// NewControllerBuilder returns a new builder to create a controller
	NewControllerBuilder() *builder.Builder

	// Client returns the underlying client
	Client() client.Client

	// Scheme returns the underlying scheme
	Scheme() *runtime.Scheme

	// Logger returns the underlying logger
	Logger() logr.Logger

	// Run checks if the reconciliation can be done and call the reconcile function to do so
	Run(req reconcile.Request, runtimeObject KubeRuntimeObject, reconcile func(deleted bool) error) (reconcile.Result, error)

	// SetOwnershipReference set ownership of the controlled object to the owner
	SetOwnershipReference(owner metav1.Object, controlled metav1.Object) error

	// GetResource is a helper to method to get a resource and do something about its availability
	GetResource(key client.ObjectKey, object client.Object, foundCallback func() (err error), notFoundCallback func() (err error)) error
}

Context represents a context of the Reconciler

func GetContext added in v0.1.5

func GetContext() Context

func NewContext

func NewContext(mgr manager.Manager) Context

NewContext creates a new reconciler Context

type Defaulting

type Defaulting interface {
	runtime.Object
	metav1.Object

	// SetSpecDefaults set the default of the object spec and returns true if any set otherwise false
	SetSpecDefaults() bool

	// SetStatusDefaults set the default of the object status and returns true if any set otherwise false
	SetStatusDefaults() bool
}

Defaulting defines interface for the kubernetes object that provides default spec and status

type KubeRuntimeObject

type KubeRuntimeObject interface {
	runtime.Object
	metav1.Object
}

KubeRuntimeObject defines interface of the kubernetes object to reconcile

type Reconciler

type Reconciler interface {
	reconcile.Reconciler

	// Configure configures the reconciler
	Configure(ctx Context) error
}

Reconciler presents the interface to be implemented by a controller-runtime controller

Jump to

Keyboard shortcuts

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