reconciler

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

	// Scheme 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() 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 runtime.Object, foundCallback func() (err error), notFoundCallback func() (err error)) error
}

Context represents a context of the Reconciler

func NewContext

func NewContext(mgr manager.Manager) Context

NewContext creates a new reconciler Context

type Defaulting

type Defaulting interface {
	runtime.Object
	metav1.Object

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

	// 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