Documentation
¶
Overview ¶
Package context is the context-controller's engine: it reacts to freshly opened Findings, runs the enhancer chain (CMDB ownership, infrastructure context — pkg/enhance plugins), records each contribution as an enrichment on the Finding's status, and advances Opened → Enhanced. It holds no tracking-system credential — projecting enrichments as issue comments is integration-controller work.
Enhancement is best-effort by design: a failing enhancer is logged and skipped, and the transition happens regardless — enrichment must never block the pipeline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FindingReconciler ¶
type FindingReconciler struct {
client.Client
// Enhancers run in order; each contributes at most one enrichment.
Enhancers []enhance.Enhancer
// RetryAfter paces retries of a cloud finding's repository lookup; zero
// means defaultRetryAfter.
RetryAfter time.Duration
// Now is the clock seam; nil means time.Now.
Now func() time.Time
// Log receives diagnostics; nil discards.
Log *slog.Logger
}
FindingReconciler runs the enhancer chain over freshly opened Findings — the CRD-native context-controller. It writes Finding status (enrichments, owners, the ContextEnhanced condition, and the Opened→Enhanced edge) and exactly one spec field: spec.repository, set once for a cloud finding that arrived without one. It holds no tracking-system credential — comments are integration-controller projection work — though an enhancer may hold a read-only credential for whatever it looks findings up in.
func (*FindingReconciler) SetupWithManager ¶
func (r *FindingReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the reconciler.