Documentation
¶
Overview ¶
Package base owns shared controller lifecycle, execution acceptance and publication.
Index ¶
- type Acquisition
- type Controller
- func (c *Controller) CompleteOrphan(id manifest.NamedResource, message string) bool
- func (c *Controller) Configure(opts Options)
- func (c *Controller) KeepEmitted(ctx context.Context, parent manifest.NamedResource, ...) (bool, error)
- func (*Controller) PreviousRender(context.Context, manifest.BaseManifest, schedule.Result) History
- func (c *Controller) SetPendingUnlessReady(id manifest.NamedResource, msg string)
- func (c *Controller) StartLifecycle()
- type Controllers
- func (c *Controllers) CompleteOrphans(orphans map[manifest.NamedResource]string, message string)
- func (c *Controllers) PreviousRender(ctx context.Context, obj manifest.BaseManifest, previous schedule.Result) History
- func (c *Controllers) ReconcileNode(ctx context.Context, id manifest.NamedResource, level manifest.DrainLevel, ...) *Execution
- type DataWait
- type Deduplication
- type Execution
- func (e *Execution) Acquire(ctx context.Context, obj manifest.BaseManifest, acquisition Acquisition, ...) (resultErr error)
- func (e *Execution) AdmitQualification(possible bool) bool
- func (e *Execution) AwaitData(ctx context.Context, wait DataWait, level manifest.DrainLevel) error
- func (e *Execution) Checkpoint() error
- func (e *Execution) Close()
- func (e *Execution) Data() *values.StoreProvider
- func (e *Execution) DataInputs(ctx context.Context, obj manifest.BaseManifest, provider dataLookup) ([]depwait.DataDependency, error)
- func (e *Execution) Dispatch[T manifest.BaseManifest, S any](ctx context.Context, level manifest.DrainLevel, state S, ...)
- func (e *Execution) Emit(ctx context.Context, id manifest.NamedResource, next *store.Emission, ...) error
- func (e *Execution) FingerprintDedup(ctx context.Context, id manifest.NamedResource, content any, ...) (Deduplication, error)
- func (e *Execution) Init(c *Controller, id manifest.NamedResource)
- func (e *Execution) InitProbe(c *Controller, object manifest.BaseManifest)
- func (e *Execution) Outcome() schedule.Kind
- func (e *Execution) ParseChildren(parent manifest.BaseManifest, docs []manifest.DocOccurrence, ...) store.ChildDocuments
- func (e *Execution) Prepare[T any](destination *Preparation[T], discovery *T, matches func(*T) bool) *T
- func (e *Execution) Probe(ctx context.Context, controller *Controller, object manifest.BaseManifest, ...) (History, []values.Result, error)
- func (e *Execution) ProbeCurrent(indexed manifest.BaseManifest) bool
- func (e *Execution) Progressed() bool
- func (e *Execution) RenderFailure(ctx context.Context, err error, documents []manifest.DocOccurrence, ...) error
- func (e *Execution) Require(ctx context.Context, deps []manifest.DependencyRef, level manifest.DrainLevel) error
- func (e *Execution) RequireRefresh[T manifest.BaseManifest](ctx context.Context, effective T, stage manifest.GateStage, ...) (T, error)
- func (e *Execution) Retire()
- func (e *Execution) Settle(ctx context.Context, level manifest.DrainLevel)
- func (e *Execution) Take(previous schedule.Result)
- func (e *Execution) Valid() bool
- type History
- type Options
- type Preparation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acquisition ¶
type Acquisition struct {
ProviderOnly bool
// Fetch acquires content with this execution's captured inputs.
Fetch func(context.Context) (source.PreparedFetch, error)
// Select MUST classify discovery-admitted content before remote credential preparation.
Select func(context.Context) (bool, error)
Resolve func(context.Context, manifest.DrainLevel) (*store.SourceArtifact, error)
// Complete receives acquired content or an allowed unavailable-material error.
Complete func(context.Context, *store.SourceArtifact, error, manifest.DrainLevel) error
}
Acquisition retains credential policy and continuations for acquired content.
type Controller ¶
type Controller struct {
Cache *cache.Cache
Store *store.Store
Tasks *task.Service
// SkipKinds is the immutable visible-output exclusion list.
SkipKinds []string
Missing *depwait.MissingPolicy
// contains filtered or unexported fields
}
Controller owns shared reconciliation lifecycle, dependency gates and publication. Configure MUST complete before StartLifecycle or dispatch.
func New ¶
func New(s *store.Store, t *task.Service) *Controller
New MUST install a real empty policy before standalone assessment.
func (*Controller) CompleteOrphan ¶
func (c *Controller) CompleteOrphan(id manifest.NamedResource, message string) bool
CompleteOrphan MUST run after task drain for an object owned by this controller.
func (*Controller) Configure ¶
func (c *Controller) Configure(opts Options)
Configure MUST install the invocation policy before dispatch.
func (*Controller) KeepEmitted ¶
func (c *Controller) KeepEmitted( ctx context.Context, parent manifest.NamedResource, request selection.PrepareRequest, ) (bool, error)
KeepEmitted MUST admit every child in the immutable generation before publication.
func (*Controller) PreviousRender ¶
func (*Controller) PreviousRender(context.Context, manifest.BaseManifest, schedule.Result) History
PreviousRender supplies no history until a concrete controller overrides it.
func (*Controller) SetPendingUnlessReady ¶
func (c *Controller) SetPendingUnlessReady(id manifest.NamedResource, msg string)
SetPendingUnlessReady initializes progress without changing an existing condition.
func (*Controller) StartLifecycle ¶
func (c *Controller) StartLifecycle()
StartLifecycle freezes reconcile-shaping configuration before dispatch.
type Controllers ¶
type Controllers struct {
Kustomization nodeController
HelmRelease nodeController
ResourceSet nodeController
Source nodeController
ArtifactGenerator nodeController
}
Controllers binds objects to their controller for execution and render history. Bindings MUST remain immutable after dispatch begins.
func (*Controllers) CompleteOrphans ¶
func (c *Controllers) CompleteOrphans(orphans map[manifest.NamedResource]string, message string)
CompleteOrphans MUST run only after all reconcile bodies drain. Each owning controller retires its failure after the final ownership assessment.
func (*Controllers) PreviousRender ¶
func (c *Controllers) PreviousRender(ctx context.Context, obj manifest.BaseManifest, previous schedule.Result) History
PreviousRender returns accepted history for the immutable declaration candidate.
func (*Controllers) ReconcileNode ¶
func (c *Controllers) ReconcileNode( ctx context.Context, id manifest.NamedResource, level manifest.DrainLevel, previous schedule.Result, ) *Execution
ReconcileNode dispatches id to its owning controller.
type DataWait ¶
type DataWait struct {
Inputs []depwait.DataDependency
// Resume retains authored positions until consumers filter their declarations.
Resume func(context.Context, manifest.DrainLevel, []values.Result) error
}
DataWait resumes a captured execution after its values inputs settle.
type Deduplication ¶
Deduplication omits its fingerprint when no stable content key exists.
type Execution ¶
type Execution struct {
*Controller
AdmissionPreparation *selection.Preparation
ProbeLeft, ProbeRight *Execution
ProbeConsumed bool
Reads store.ReadSet
Unreadable []manifest.NamedResource
Blocked []manifest.NamedResource
Disposition store.AssessmentKind
// contains filtered or unexported fields
}
Execution MUST retain its input capture through every output borrower.
func (*Execution) Acquire ¶
func (e *Execution) Acquire( ctx context.Context, obj manifest.BaseManifest, acquisition Acquisition, level manifest.DrainLevel, ) (resultErr error)
Acquire fetches content or retains credential settlement before completing its consumer.
func (*Execution) AdmitQualification ¶
AdmitQualification settles a negative precondition only without ordinary demand.
func (*Execution) AwaitData ¶
AwaitData retains availability separately from required authored readiness gates.
func (*Execution) Checkpoint ¶
Checkpoint validates captured inputs and admission before execution continues.
func (*Execution) Close ¶
func (e *Execution) Close()
Close retires all provenance borrowed by the completed invocation.
func (*Execution) Data ¶
func (e *Execution) Data() *values.StoreProvider
Data MUST remain bound to this execution's input capture.
func (*Execution) DataInputs ¶
func (e *Execution) DataInputs( ctx context.Context, obj manifest.BaseManifest, provider dataLookup, ) ([]depwait.DataDependency, error)
DataInputs MUST assess promotion before capturing values for either render path.
func (*Execution) Dispatch ¶
func (e *Execution) Dispatch[T manifest.BaseManifest, S any]( ctx context.Context, level manifest.DrainLevel, state S, reconcile func(S, context.Context, T, manifest.DrainLevel) error, )
Dispatch runs a captured declaration through the common acceptance path.
func (*Execution) Emit ¶
func (e *Execution) Emit( ctx context.Context, id manifest.NamedResource, next *store.Emission, payloads map[manifest.NamedResource]*store.SourceArtifact, ) error
Emit publishes the candidate inventory with its consumed provenance.
func (*Execution) FingerprintDedup ¶
func (e *Execution) FingerprintDedup( ctx context.Context, id manifest.NamedResource, content any, attempt *store.Emission, ) (Deduplication, error)
FingerprintDedup derives the replay key from content and reuses accepted children. Nil or unmarshalable content MUST bypass replay; preflight failures still win.
func (*Execution) Init ¶
func (e *Execution) Init(c *Controller, id manifest.NamedResource)
Init starts capture in caller-owned storage before declaration or dependency assessment. The execution MUST remain live until its registrations and output borrowers retire.
func (*Execution) InitProbe ¶
func (e *Execution) InitProbe(c *Controller, object manifest.BaseManifest)
InitProbe MUST NOT publish runtime admission or status.
func (*Execution) Outcome ¶
Outcome returns the retained readiness decision without reading the store.
func (*Execution) ParseChildren ¶
func (e *Execution) ParseChildren( parent manifest.BaseManifest, docs []manifest.DocOccurrence, opts manifest.ParseDocOptions, ) store.ChildDocuments
ParseChildren selects output and retains authoritative sanitized child documents. The returned objects and maps MUST remain immutable after publication.
func (*Execution) Prepare ¶
func (e *Execution) Prepare[T any](destination *Preparation[T], discovery *T, matches func(*T) bool) *T
Prepare MUST NOT transfer input captures or grant publication authority.
func (*Execution) Probe ¶
func (e *Execution) Probe( ctx context.Context, controller *Controller, object manifest.BaseManifest, previous schedule.Result, ) (History, []values.Result, error)
Probe MUST return its live assessment after capture starts, including on errors.
func (*Execution) ProbeCurrent ¶
func (e *Execution) ProbeCurrent(indexed manifest.BaseManifest) bool
ProbeCurrent MUST preserve the declaration authority captured at initialization.
func (*Execution) Progressed ¶
Progressed reports an execution that performed work beyond equal-input replay.
func (*Execution) RenderFailure ¶
func (e *Execution) RenderFailure( ctx context.Context, err error, documents []manifest.DocOccurrence, unreadable []manifest.Reference, ) error
RenderFailure MUST precede publication and never excuses a failed readable document.
func (*Execution) Require ¶
func (e *Execution) Require(ctx context.Context, deps []manifest.DependencyRef, level manifest.DrainLevel) error
Require assesses and retains readiness gates from the captured inputs.
func (*Execution) RequireRefresh ¶
func (e *Execution) RequireRefresh[T manifest.BaseManifest]( ctx context.Context, effective T, stage manifest.GateStage, level manifest.DrainLevel, ) (T, error)
RequireRefresh gates effective inputs against the execution's captured canonical declaration. Prepared clones MUST remain distinct from the canonical snapshot that produced them.
func (*Execution) Retire ¶
func (e *Execution) Retire()
Retire releases superseded assessment cells while retaining borrowed output.
func (*Execution) Settle ¶
func (e *Execution) Settle(ctx context.Context, level manifest.DrainLevel)
Settle classifies retained unresolved gates without rendering again.
type History ¶
type History struct {
Assessment *Execution
Records iter.Seq2[manifest.NamedResource, manifest.DiscoveryRecord]
Complete bool
}
History MUST retain its assessment through every possible preparation consumer.
type Options ¶
type Options struct {
Cache *cache.Cache
// Loader supplies the invocation's declaration admission boundary.
Loader *loader.Loader
// SkipKinds is the immutable visible-output exclusion list.
SkipKinds []string
// Session owns restricted reconciliation membership.
Session *selection.Session
// Index contains immutable source-qualified discovery evidence.
Index *manifest.DiscoveryIndex
// Existence is the file-existence lookup depwait uses to lazy-promote
// file-indexed deps and to distinguish a render-only dep still in flight
// from a typo'd one. See depwait.ExistenceLookup.
Existence depwait.ExistenceLookup
Missing *depwait.MissingPolicy
}
Options contains immutable controller configuration installed before dispatch.
type Preparation ¶
type Preparation[T any] struct { // contains filtered or unexported fields }
Preparation MUST remain inline in its final consumer's storage.