controller

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package controller hosts the Wavefront reconciler: the control loop that wires detection (internal/gitpoll), discovery (internal/adapter), topology (internal/graph), the rolling-admission core (internal/engine) and the pin mechanism (internal/pin) into one stateless pass.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WavefrontReconciler

type WavefrontReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	Recorder  events.EventRecorder
	Adapter   adapter.Adapter
	Strategy  selection.Strategy
	Poller    *gitpoll.Poller
	PinWriter *pin.Writer
	Clock     func() time.Time
	Metrics   *metrics.Instruments
	// contains filtered or unexported fields
}

WavefrontReconciler reconciles a Wavefront object.

Every pass is a full recalculation: discovery, source resolution, graph derivation and admissibility are all derived from live cluster state plus the poller's observations, never from stored orchestration state. The only state status carries forward is edge-trigger ledgers, each diffed against the exact capped, sorted mirror it itself holds: the hold ledger (status.Held, against the pass's derived holds) and the shadow-admission ledger (status.Shadow, against this pass's admissions), never against the unbounded live-derived set, so a restart replays at most StatusListCap detections rather than an unbounded backlog. status.Pinned is the release ledger: every source this Wavefront has a claim on, rewritten by settlePins.

func (*WavefrontReconciler) Reconcile

func (r *WavefrontReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile runs one full evaluation of the fleet and executes the admissions it derives.

The releasePinsFinalizer makes deletion give the fleet back: every pin this Wavefront owns is relinquished before the object goes, so no source is left frozen on a pin nothing will ever advance. The follow-up NotFound reconcile then drops its poll set and metrics.

func (*WavefrontReconciler) SetupWithManager

func (r *WavefrontReconciler) SetupWithManager(mgr ctrl.Manager, pollEvents <-chan event.GenericEvent) error

SetupWithManager wires the controller into the manager. The Flux watches carry no GenerationChangedPredicate: gates are reachable through unlabelled objects and it is precisely their *status* changes that unblock a wavefront.

Jump to

Keyboard shortcuts

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