controllers

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseController

type BaseController struct {
	// Ctx is the outer clabernetes context, controllers can use it to check if it is done, spawn
	// new contexts from it, and pass it to other objects such as the messaging client.
	Ctx context.Context
	// AppName is the name of the clabernetes app (the helm release name).
	AppName string
	// ControllerNamespace is the namespace the controller is running in.
	ControllerNamespace string
	Log                 claberneteslogging.Instance
	Config              *clientgorest.Config
	Client              ctrlruntimeclient.Client
}

BaseController is the base clabernetes controller that is embedded in all clabernetes controllers, it provides common attributes for the controllers such as a log instance.

func NewBaseController

func NewBaseController(
	ctx context.Context,
	controllerName,
	appName string,
	config *clientgorest.Config,
	client ctrlruntimeclient.Client,
) *BaseController

NewBaseController returns a new BaseController object to embed in clabernetes controllers.

func (*BaseController) LogReconcileCompleteObjectNotExist

func (c *BaseController) LogReconcileCompleteObjectNotExist(_ ctrlruntime.Request)

LogReconcileCompleteObjectNotExist is a convenience/consistency function to log the successful completion of a reconcile when an object doesn't exist anymore.

func (*BaseController) LogReconcileCompleteSuccess

func (c *BaseController) LogReconcileCompleteSuccess(_ ctrlruntime.Request)

LogReconcileCompleteSuccess is a convenience/consistency function to log the successful completion of a reconcile.

func (*BaseController) LogReconcileFailedGettingObject

func (c *BaseController) LogReconcileFailedGettingObject(req ctrlruntime.Request, err error)

LogReconcileFailedGettingObject is a convenience/consistency function to log an error on failure to get the object under reconciliation.

func (*BaseController) LogReconcileStart

func (c *BaseController) LogReconcileStart(req ctrlruntime.Request)

LogReconcileStart is a convenience/consistency function to log the start of a reconcile event.

func (*BaseController) LogReconcileStartDelete

func (c *BaseController) LogReconcileStartDelete(_ ctrlruntime.Request)

LogReconcileStartDelete is a convenience/consistency function to log the start of a *delete* reconcile event.

func (*BaseController) ShouldIgnoreReconcile added in v0.0.17

func (c *BaseController) ShouldIgnoreReconcile(obj ctrlruntimeclient.Object) bool

ShouldIgnoreReconcile checks if the given object has the LabelIgnoreReconcile label, if so, it logs a message and returns true indicating the concrete controller should skip reconciling the object.

type Controller

type Controller interface {
	// SetupWithManager sets the given controller up with the controller-runtime manager.
	SetupWithManager(mgr ctrlruntime.Manager) error
	// Reconcile is the actual reconcile function of the controller.
	Reconcile(
		ctx context.Context,
		req ctrlruntime.Request,
	) (ctrlruntime.Result, error)
}

Controller defines a clabernetes controller.

type NewController

type NewController func(
	clabernetes clabernetesmanagertypes.Clabernetes,
) Controller

NewController defines a function that creates and returns a clabernetes Controller object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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