handler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CtrlClient ctrl.Client
	Logger     micrologger.Logger
	Name       string
}

type Interface

type Interface interface {
	// EnsureCreated is called when the observed runtime object is created or
	// updated.
	// After the successful execution of EnsureCreated, condition on
	// reconciled object is created or updated. This method must be idempotent.
	EnsureCreated(ctx context.Context, obj interface{}) error
	// EnsureDeleted is called when the observed runtime object is requested to be
	// deleted, which means its DeletionTimestamp is set, but the runtime object
	// itself is not garbage collected yet.
	// After the execution of EnsureDeleted,
	// condition on reconciled object is updated to reflect object deletion. If
	// deletion could not be done successfully handler implementations must
	// request to keep finalizers using the available controller context control
	// flow primitives.
	// In case EnsureDeleted returns an error, finalizers are kept automatically.
	// This method must be idempotent.
	EnsureDeleted(ctx context.Context, obj interface{}) error
	// Name returns the handler's name used for identification e.g. in logging
	// and metrics components.
	Name() string
}

Interface defines the building blocks of an operator's reconciliation logic. Note there can be multiple hanlders reconciling the same object in a chain. In that case they are guaranteed to be executed in order one after another.

Jump to

Keyboard shortcuts

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