Documentation
¶
Overview ¶
Package loader hydrates a Store from Flux source filesystems.
Index ¶
- func AppliesToEntry(s sourceStore, application *manifest.EntryApplication, ...) bool
- func Claims(s *store.Store, repoRoot string, candidates []*manifest.Kustomization) []manifest.KSClaim
- func LoadDocuments(ctx context.Context, r io.Reader, path string) ([]store.Declaration, error)
- func ParseChildren(parent manifest.BaseManifest, docs []manifest.DocOccurrence, ...) store.ChildDocuments
- func Prepare(doc manifest.DocOccurrence, opts manifest.ParseDocOptions) (store.Child, manifest.DocOccurrence, bool)
- func Promote(ctx context.Context, st *store.Store, id manifest.NamedResource, ...) ([]store.Child, error)
- func ValidateDeclarations(children []store.Declaration) error
- type BuiltInput
- type Catalog
- func (c *Catalog) CatalogObject(id manifest.NamedResource) manifest.BaseManifest
- func (c *Catalog) Close()
- func (c *Catalog) RootEvidence(id manifest.NamedResource, reads *store.ReadSet, completeOwners bool) selection.RootEvidence
- func (c *Catalog) SourceExternal(id manifest.NamedResource, reads *store.ReadSet) bool
- type Loader
- func (l *Loader) AdmissionCandidate(id manifest.NamedResource) store.Child
- func (l *Loader) Admit(ctx context.Context, repoRoot string) error
- func (l *Loader) AdmitDeclarations(children []store.Declaration)
- func (l *Loader) BuiltChildren(root string, owner manifest.NamedResource, reads *store.ReadSet) ([]store.Child, bool)
- func (l *Loader) CatalogObject(id manifest.NamedResource) manifest.BaseManifest
- func (l *Loader) Close()
- func (l *Loader) CompleteDeclarations(ctx context.Context, demand selection.DeclarationDemand) (*manifest.DiscoveryIndex, error)
- func (*Loader) DeclarationContents() func(map[string]any) store.DeclarationContent
- func (l *Loader) DetachCatalog() *Catalog
- func (l *Loader) EntryFailure(ctx context.Context, repoRoot string) error
- func (l *Loader) EntryFrontier(ctx context.Context, input *store.SourceArtifact, path string) (bool, error)
- func (l *Loader) EntryRoots(published iter.Seq[manifest.BaseManifest], reads *store.ReadSet) []selection.OccurrenceFacts
- func (l *Loader) FinalizeIndex(ctx context.Context, repoRoot string, freeze bool) error
- func (l *Loader) IndexedObject(id manifest.NamedResource, r manifest.DiscoveryRecord) store.Child
- func (l *Loader) IsFileIndexed(id manifest.NamedResource) bool
- func (l *Loader) Kustomizations() []store.Child
- func (l *Loader) Load(ctx context.Context, root string, owner manifest.NamedResource, ...) (_ int, resultErr error)
- func (l *Loader) Occurrence(id manifest.NamedResource) (selection.OccurrenceFacts, bool)
- func (l *Loader) OccurrenceClaims(repoRoot string, occurrences []selection.OccurrenceFacts) []manifest.KSClaim
- func (l *Loader) OccurrenceObject(ctx context.Context, occurrenceValue *selection.OccurrenceFacts, ...) (store.Child, error)
- func (l *Loader) OccurrenceRoots(id manifest.NamedResource) (manifest.NamedResource, []string)
- func (l *Loader) Occurrences(ctx context.Context, dir, targetNamespace string) ([]selection.OccurrenceFacts, error)
- func (l *Loader) Packages(ctx context.Context) ([]PackageEvidence, error)
- func (l *Loader) ParsedInputs() *ParsedInputs
- func (l *Loader) PathObjects() []selection.OccurrenceFacts
- func (l *Loader) PersistInputs(ctx context.Context) error
- func (l *Loader) PreparedObject(id manifest.NamedResource, reads *store.ReadSet) (store.Child, bool)
- func (l *Loader) ProducerFacts(object manifest.BaseManifest) selection.ProducerFacts
- func (l *Loader) PromoteOrphans(ctx context.Context) error
- func (l *Loader) PromotionDocuments(id manifest.NamedResource) []store.Child
- func (l *Loader) ReferenceFacts(id manifest.NamedResource, index *manifest.DiscoveryIndex, ...) store.ReferenceFacts
- func (l *Loader) References(id manifest.NamedResource) iter.Seq[manifest.Reference]
- func (l *Loader) RegisterBuilt(ctx context.Context, input BuiltInput, docs []store.Child) error
- func (l *Loader) ResolveRoot(ctx context.Context, reads *store.ReadSet, source manifest.NamedResource, ...) (string, bool, error)
- func (l *Loader) Retire()
- func (l *Loader) RootEvidence(id manifest.NamedResource, reads *store.ReadSet, completeOwners bool) selection.RootEvidence
- func (l *Loader) SelectionIndex() *manifest.DiscoveryIndex
- func (l *Loader) SourceFacts(source manifest.NamedResource, reads *store.ReadSet) selection.SourceFacts
- func (l *Loader) Sources(ctx context.Context) iter.Seq2[store.Child, error]
- func (l *Loader) SweepPreparations()
- type PackageEvidence
- type ParsedInputs
- type PromoteOptions
- type SourceLocation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppliesToEntry ¶
func AppliesToEntry( s sourceStore, application *manifest.EntryApplication, input *store.SourceArtifact, entry string, ) bool
AppliesToEntry reports whether a resolved application reads the admitted entry.
func Claims ¶
func Claims(s *store.Store, repoRoot string, candidates []*manifest.Kustomization) []manifest.KSClaim
Claims builds reporting claims from caller-owned candidates, including external sources and committed source coordinates. Discovery MUST use Loader.claims instead.
func LoadDocuments ¶
LoadDocuments prepares required invocation declarations without exposing payloads in errors.
func ParseChildren ¶
func ParseChildren( parent manifest.BaseManifest, docs []manifest.DocOccurrence, opts manifest.ParseDocOptions, skipKinds []string, ) store.ChildDocuments
ParseChildren selects output and retains authoritative sanitized child documents. Producer namespace policy overrides opts.DefaultNamespace; raw parents use that default. The returned objects and maps MUST remain immutable after publication.
func Prepare ¶
func Prepare(doc manifest.DocOccurrence, opts manifest.ParseDocOptions) (store.Child, manifest.DocOccurrence, bool)
Prepare MUST preserve the sanitized outcome even when typed admission fails.
func Promote ¶
func Promote( ctx context.Context, st *store.Store, id manifest.NamedResource, opts PromoteOptions, ) ([]store.Child, error)
Promote acquires exact children; callers must admit the generation before publication.
func ValidateDeclarations ¶
func ValidateDeclarations(children []store.Declaration) error
ValidateDeclarations requires authored identity against all invocation definitions.
Types ¶
type BuiltInput ¶
type BuiltInput struct {
Root string
Owner, Source manifest.NamedResource
Reads map[string]bool
// RegisterBuilt owns Support on every call, including rejection.
Support *store.ReadSet
}
BuiltInput binds prepared documents and observed source-relative reads to their ordinary producer.
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog borrows immutable loader facts until its owner calls Close.
func (*Catalog) CatalogObject ¶
func (c *Catalog) CatalogObject(id manifest.NamedResource) manifest.BaseManifest
CatalogObject borrows the declaration with its effective identity.
func (*Catalog) Close ¶
func (c *Catalog) Close()
Close releases borrowed catalog storage and is safe to repeat.
func (*Catalog) RootEvidence ¶
func (c *Catalog) RootEvidence( id manifest.NamedResource, reads *store.ReadSet, completeOwners bool, ) selection.RootEvidence
RootEvidence with completeOwners false requires the caller to complete support with its preparation inventory.
func (*Catalog) SourceExternal ¶
SourceExternal uses the caller's capture so replacement invalidates the observation.
type Loader ¶
type Loader struct {
Store *store.Store
Options options
// SourceRoot anchors slash-separated discovery coordinates and bounds
// standalone input admission. Source artifacts supply their own FS.
SourceRoot string
// Index records static discovery facts and is initialized by New. Caller
// replacements MUST initialize Records before Load. Mutable until FinalizeIndex returns.
Index *manifest.DiscoveryIndex
// InputContent contains transient evidence paired with the current derived index.
InputContent map[manifest.NamedResource]inputprojection.Projection
// IgnoreFile, when non-empty, is the gitignore-grammar file Load
// reads in place of <root>/.krmignore, with its patterns anchored
// at the Load root. Discovery sets it for the --path scan only:
// spec.path targets followed afterwards keep their own
// per-directory .krmignore, exactly as if the file sat at the
// scan root.
IgnoreFile string
// PreferExisting suppresses overwrites of resources already in
// the store and their discovery records. Used by the
// orchestrator's recursive spec.path discovery so the initial
// --path scan's data wins over downstream paths that may point
// into a different tree.
PreferExisting bool
// contains filtered or unexported fields
}
Loader collects source-qualified discovery evidence before admitting roots. Source membership MUST remain stable across sequential Load calls. The first Load classifies the entry for all subsequent loads; independent entry policies require separate loaders.
func (*Loader) AdmissionCandidate ¶
func (l *Loader) AdmissionCandidate(id manifest.NamedResource) store.Child
AdmissionCandidate borrows the immutable declaration prepared during construction.
func (*Loader) AdmitDeclarations ¶
func (l *Loader) AdmitDeclarations(children []store.Declaration)
AdmitDeclarations retains pathless reference evidence before repository discovery.
func (*Loader) BuiltChildren ¶
func (l *Loader) BuiltChildren(root string, owner manifest.NamedResource, reads *store.ReadSet) ([]store.Child, bool)
BuiltChildren requires current construction membership and the original preparation capture.
func (*Loader) CatalogObject ¶
func (l *Loader) CatalogObject(id manifest.NamedResource) manifest.BaseManifest
CatalogObject returns immutable reporting facts without hydrating or admitting the declaration.
func (*Loader) Close ¶
func (l *Loader) Close()
Close MUST follow every loader and catalog consumer and preserve detached result data.
func (*Loader) CompleteDeclarations ¶
func (l *Loader) CompleteDeclarations( ctx context.Context, demand selection.DeclarationDemand, ) (*manifest.DiscoveryIndex, error)
CompleteDeclarations MUST finish before readers consume the immutable index.
func (*Loader) DeclarationContents ¶
func (*Loader) DeclarationContents() func(map[string]any) store.DeclarationContent
DeclarationContents MUST be confined to one serial admission preparation. Independent preparations never share mutable memoization state.
func (*Loader) DetachCatalog ¶
DetachCatalog keeps borrowed catalog facts alive beyond Loader.Close.
func (*Loader) EntryFailure ¶
EntryFailure MUST defer admission until selection consumes its iterator.
func (*Loader) EntryFrontier ¶
func (l *Loader) EntryFrontier(ctx context.Context, input *store.SourceArtifact, path string) (bool, error)
EntryFrontier must conservatively retain packages whose applications cannot be ruled out.
func (*Loader) EntryRoots ¶
func (l *Loader) EntryRoots( published iter.Seq[manifest.BaseManifest], reads *store.ReadSet, ) []selection.OccurrenceFacts
EntryRoots MUST use captured admission evidence without I/O or publication.
func (*Loader) FinalizeIndex ¶
FinalizeIndex MUST freeze source-qualified graph contributions before reconciliation.
func (*Loader) IndexedObject ¶
func (l *Loader) IndexedObject(id manifest.NamedResource, r manifest.DiscoveryRecord) store.Child
IndexedObject returns the retained declaration under its contextual identity.
func (*Loader) IsFileIndexed ¶
func (l *Loader) IsFileIndexed(id manifest.NamedResource) bool
IsFileIndexed reports whether source input supplies an authoritative declaration for id.
func (*Loader) Kustomizations ¶
Kustomizations returns eligible source-qualified owner evidence.
func (*Loader) Load ¶
func (l *Loader) Load( ctx context.Context, root string, owner manifest.NamedResource, work *manifest.WorkRecord, ) (_ int, resultErr error)
Load records Flux objects under root by walking the kustomize resource graph. When root has a kustomization.yaml it's treated as a kustomize package and only files reachable through `resources:` are loaded; when it has none, a recursive walk finds and enters kustomize packages it encounters, loading every YAML otherwise.
Honors ctx cancellation; visited-set protects against cycles.
func (*Loader) Occurrence ¶
func (l *Loader) Occurrence(id manifest.NamedResource) (selection.OccurrenceFacts, bool)
Occurrence borrows exact declaration coordinates and immutable parsed facts.
func (*Loader) OccurrenceClaims ¶
func (l *Loader) OccurrenceClaims(repoRoot string, occurrences []selection.OccurrenceFacts) []manifest.KSClaim
OccurrenceClaims derives claims from mounted source views without admitting document identities.
func (*Loader) OccurrenceObject ¶
func (l *Loader) OccurrenceObject( ctx context.Context, occurrenceValue *selection.OccurrenceFacts, input *store.SourceArtifact, ) (store.Child, error)
OccurrenceObject MUST hydrate only the declaration in its admitted source view.
func (*Loader) OccurrenceRoots ¶
func (l *Loader) OccurrenceRoots(id manifest.NamedResource) (manifest.NamedResource, []string)
OccurrenceRoots borrows the parsed render paths in the effective source namespace.
func (*Loader) Occurrences ¶
func (l *Loader) Occurrences(ctx context.Context, dir, targetNamespace string) ([]selection.OccurrenceFacts, error)
Occurrences projects cached declarations through the existing contextual traversal.
func (*Loader) Packages ¶
func (l *Loader) Packages(ctx context.Context) ([]PackageEvidence, error)
Packages snapshots resource graph inputs already traversed by Load.
func (*Loader) ParsedInputs ¶
func (l *Loader) ParsedInputs() *ParsedInputs
ParsedInputs snapshots parsed bodies without retaining entry admission state.
func (*Loader) PathObjects ¶
func (l *Loader) PathObjects() []selection.OccurrenceFacts
PathObjects returns live path witnesses, retaining occurrences until construction completes.
func (*Loader) PersistInputs ¶
PersistInputs publishes only content-certified authored facts through the cache owner.
func (*Loader) PreparedObject ¶
func (l *Loader) PreparedObject(id manifest.NamedResource, reads *store.ReadSet) (store.Child, bool)
PreparedObject captures only the requested indexed document and its build support.
func (*Loader) ProducerFacts ¶
func (l *Loader) ProducerFacts(object manifest.BaseManifest) selection.ProducerFacts
ProducerFacts reuses immutable projections across concurrent preparations.
func (*Loader) PromoteOrphans ¶
PromoteOrphans MUST run after index finalization.
func (*Loader) PromotionDocuments ¶
func (l *Loader) PromotionDocuments(id manifest.NamedResource) []store.Child
PromotionDocuments returns the immutable indexed batch used to promote id.
func (*Loader) ReferenceFacts ¶
func (l *Loader) ReferenceFacts(id manifest.NamedResource, index *manifest.DiscoveryIndex, consumer manifest.NamedResource, ) store.ReferenceFacts
ReferenceFacts resolves data against the current discovery index before publication.
func (*Loader) References ¶
References MUST consume immutable declaration evidence synchronously.
func (*Loader) RegisterBuilt ¶
RegisterBuilt MUST receive sanitized immutable build output and retire support in publication order.
func (*Loader) ResolveRoot ¶
func (l *Loader) ResolveRoot( ctx context.Context, reads *store.ReadSet, source manifest.NamedResource, root string, ) (string, bool, error)
ResolveRoot confines traversal to a valid captured source artifact.
func (*Loader) Retire ¶
func (l *Loader) Retire()
Retire releases admission readers while preserving completed owners' read tracking.
func (*Loader) RootEvidence ¶
func (l *Loader) RootEvidence( id manifest.NamedResource, reads *store.ReadSet, completeOwners bool, ) selection.RootEvidence
RootEvidence with completeOwners false requires the caller to complete support with its preparation inventory.
func (*Loader) SelectionIndex ¶
func (l *Loader) SelectionIndex() *manifest.DiscoveryIndex
SelectionIndex borrows the loader-owned census; callers must not mutate it.
func (*Loader) SourceFacts ¶
func (l *Loader) SourceFacts(source manifest.NamedResource, reads *store.ReadSet) selection.SourceFacts
SourceFacts MUST capture current reads before reusing source evidence.
func (*Loader) Sources ¶
Sources yields eligible immutable source-artifact evidence in unspecified order.
func (*Loader) SweepPreparations ¶
func (l *Loader) SweepPreparations()
SweepPreparations MUST run at a serial construction or quiescent runtime boundary.
type PackageEvidence ¶
type PackageEvidence struct {
Path string
Scans []string
Occurrences []selection.OccurrenceFacts
Independent bool
}
PackageEvidence retains package provenance and shared root admission.
type ParsedInputs ¶
type ParsedInputs struct {
// contains filtered or unexported fields
}
ParsedInputs retains immutable parsed content from exact admitted source views.
func (*ParsedInputs) Matches ¶
func (p *ParsedInputs) Matches(input *store.SourceArtifact) bool
Matches reports whether input owns a source view retained by these parsed facts.
type PromoteOptions ¶
type PromoteOptions struct {
Record manifest.Production
Reads *store.ReadSet
Documents []store.Child
}
PromoteOptions binds acquisition to an exact source and captured generation.
type SourceLocation ¶
SourceLocation binds a source path to its pin and ownership.
func SourceView ¶
func SourceView(s sourceStore, ref manifest.NamedResource, repoRoot string) SourceLocation
SourceView classifies an admitted source coordinate, committed pin and external ownership. Unavailable sources MUST NOT borrow bootstrap bytes or claim unrelated working-tree files.
Source Files
¶
- authored_admission.go
- authored_lookup.go
- authored_namespaces.go
- authored_projection.go
- authored_records.go
- catalog.go
- chart_readers.go
- children.go
- completion.go
- contextual.go
- declaration_content.go
- declarations.go
- entry_frontier.go
- generators.go
- ignore.go
- index.go
- inherit.go
- input_cache.go
- input_evidence.go
- input_frame.go
- input_loads.go
- input_walks.go
- inputs.go
- kustomization.go
- loader.go
- native_root_facts.go
- occurrences.go
- orphans.go
- parent.go
- parse.go
- paths.go
- promote.go
- readers.go
- references.go
- resolve_root.go
- root_admission.go
- root_inventory.go
- root_owner_inventory.go
- root_support.go
- scalar_projection.go
- scope_admission.go
- scope_construction.go
- scope_eligibility.go
- scope_traversal.go
- selection_facts.go
- selection_reader.go
- selfproduce.go
- selfproduce_built.go
- selfproduce_coverage.go
- selfproduce_record.go
- selfproduce_roots.go
- selfproduce_setup.go
- selfproduce_unowned.go
- selfproduce_visits.go
- selfproduce_walk.go
- source_binding.go
- template.go
- transformer_ns.go
- traversal.go
- traversal_walk.go