Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reconcilable ¶
type Reconcilable interface {
// Reconcile performs a reconciliation step to ensure the desired state matches the actual state.
// Returns:
// - result: reconcile.Result indicating when to requeue (if needed)
// - done: true if reconciliation completed successfully, false if it needs to be retried
// - err: any error encountered during reconciliation
Reconcile(ctx *chetypes.DeployContext) (result reconcile.Result, done bool, err error)
// Finalize performs cleanup operations before the resource is deleted.
// All created resources should be removed, including:
// - finalizers
// - cluster scoped resources
// Returns true if finalization completed successfully, false otherwise.
// TODO make Finalize return error as well
Finalize(ctx *chetypes.DeployContext) (done bool)
}
Reconcilable defines the interface for components that can be reconciled and finalized.
type ReconcilerManager ¶
type ReconcilerManager struct {
// contains filtered or unexported fields
}
ReconcilerManager manages a collection of Reconcilable objects and executes them in order.
func NewReconcilerManager ¶
func NewReconcilerManager() *ReconcilerManager
func (*ReconcilerManager) AddReconciler ¶
func (r *ReconcilerManager) AddReconciler(reconciler Reconcilable)
func (*ReconcilerManager) FinalizeAll ¶
func (r *ReconcilerManager) FinalizeAll(ctx *chetypes.DeployContext) (doneAll bool)
FinalizeAll invokes the Finalize method on all registered reconcilers. Unlike ReconcileAll, this method continues executing all finalizers even if one fails, ensuring all cleanup operations have a chance to run. Returns true if all finalizers completed successfully, false if any failed.
func (*ReconcilerManager) ReconcileAll ¶
func (r *ReconcilerManager) ReconcileAll(ctx *chetypes.DeployContext) (reconcile.Result, bool, error)
ReconcileAll reconciles all registered reconcilers in the order they were added. The reconciliation process stops at the first reconciler that returns done=false, ensuring dependencies between reconcilers are respected.