Skip to main content

Module controller

Module controller 

Source
Expand description

kube-rs controller wrapper for crate::LavaArchitectureSpec.

Compiled only when the controller feature is enabled. The controller watches LavaArchitecture CRs in the cluster and drives each one through crate::reconcile using a caller- supplied synthesize callback. The callback is the seam through which magma-lava (or the future in-process magma library) is plugged in — keeps this module synthesis-engine-agnostic.

Structs§

ConditionCR
Context
Per-controller shared context. The chain handle is Arc<Mutex> so every reconcile pass appends through the same sink — across every LavaArchitecture CR on this operator instance, every receipt links to the same monotonic sequence.
EscalationLadderCR
EscalationTierCR
LavaArchitecture
Auto-generated derived type for LavaArchitectureSpecCR via CustomResource
LavaArchitectureDependency
Auto-generated derived type for LavaArchitectureDependencySpec via CustomResource
LavaArchitectureDependencySpec
Typed kube-rs CRD for lava_dependency::LavaArchitectureDependency.
LavaArchitectureSpecCR
kube-rs typed shape. Mirrors crate::LavaArchitectureSpec but carries the #[derive(CustomResource)] plumbing kube-rs needs to dispatch the watch + patch loop.
LavaArchitectureStatusCR
NotifyTargetCR
Flat notify-target shape — kind is a free string + remaining fields are optional. The lava-anomaly typed enum (Slack | Ntfy | Pagerduty | Email | Webhook | Custom) is reconstructed at use-site. Flat layout keeps the JsonSchema derivation simple (kube-rs apiextensions/v1 rejects tagged-enum CRDs with per-variant property schemas).
RemediationPolicy
Auto-generated derived type for RemediationPolicySpec via CustomResource
RemediationPolicySpec
Typed kube-rs CRD for lava_anomaly::RemediationPolicy. Operators attach one of these per cluster (or per environment) and reference it from LavaArchitectureSpecCR.remediationPolicyRef.
ResourceRefCR
SourceCR
Flat source descriptor — inline, name, and the three git fields are all optional + the consumer picks the populated one. Flat shape avoids kube-rs JsonSchema discriminated-union pitfalls

Enums§

ControllerError

Functions§

error_policy
phase_str
Re-export of Phase::as_str kept here for symmetry with the pre-M2 controller API. New code should use Phase::as_str directly.
reconcile_one
Reconcile one resource. Drives the full 7-beat Viggy tick via viggy_loop::LavaPromessaController + ViggyEngine, appends a signed receipt to the shared OutcomeChain, and patches the resource’s .status to reflect the typed tick outcome.
run
Run the controller loop. Caller passes a synthesize callback that bridges to magma-lava (in-process) or shells out to tofu/terraform.

Type Aliases§

SynthesizeFn
Synthesize callback — caller supplies the real magma-lava bridge. Returning Err is captured into a Failed Phase + Condition by the reconcile loop.