context

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 18 Imported by: 0 modules, 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 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) Reconcile

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

Reconcile enhances one Finding.

func (*FindingReconciler) SetupWithManager

func (r *FindingReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager wires the reconciler.

Jump to

Keyboard shortcuts

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