reconciler

package
v0.0.0-...-6ccfea3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: EPL-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package reconciler provides the Reconcilable interface and the ReconcilerManager, which together form the ordered pipeline that provisions and cleans up the components of a CheCluster custom resource.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reconcilable

type Reconcilable interface {
	// Reconcile ensures the actual state of the component matches the desired state
	// defined by the CheCluster CR. It is called repeatedly until it reports done,
	// so it must tolerate being re-invoked on partially reconciled state.
	// Returns:
	// - result: reconcile.Result to propagate to the controller, e.g. RequeueAfter
	//   when the component is not ready yet and must be retried later
	// - done: true when the component is fully reconciled; false when it is not ready
	//   or failed, which stops the pipeline until it is retried
	// - err: any error encountered during reconciliation
	Reconcile(cheCtx *chetypes.CheContext) (result reconcile.Result, done bool, err error)

	// Finalize removes the resources created by the component before the CheCluster CR is deleted.
	// It is re-invoked on every reconcile until it succeeds, so it must be idempotent.
	// Returns any error encountered during finalization.
	Finalize(cheCtx *chetypes.CheContext) (err error)
}

Reconcilable is implemented by every CheCluster component reconciler. Each implementation owns the resources of a single component and is responsible for both provisioning them (Reconcile) and cleaning them up (Finalize).

type ReconcilerManager

type ReconcilerManager struct {
	// contains filtered or unexported fields
}

ReconcilerManager executes a collection of Reconcilables as an ordered pipeline. Reconcilers run in registration order, and each one may rely on the components provisioned by the reconcilers registered before it.

func NewReconcilerManager

func NewReconcilerManager() *ReconcilerManager

func (*ReconcilerManager) AddReconciler

func (r *ReconcilerManager) AddReconciler(reconciler Reconcilable)

func (*ReconcilerManager) FinalizeAll

func (r *ReconcilerManager) FinalizeAll(cheCtx *chetypes.CheContext) error

FinalizeAll invokes the Finalize method on all registered reconcilers. Unlike ReconcileAll, it continues executing all finalizers even if one fails, ensuring every cleanup operation has a chance to run. It returns an error combining the errors of all failed finalizers, each wrapped with the reconciler type name; failed finalizers are retried on the next reconciliation attempt, which is safe because Finalize is idempotent.

func (*ReconcilerManager) ReconcileAll

func (r *ReconcilerManager) ReconcileAll(cheCtx *chetypes.CheContext) (reconcile.Result, bool, error)

ReconcileAll reconciles all registered reconcilers in registration order. The pipeline stops at the first reconciler that returns done=false, so that reconcilers depending on earlier components are not run before those are ready.

Jump to

Keyboard shortcuts

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