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
- type Loader
- func (l *Loader) AdmissionCandidate(id manifest.NamedResource) store.Child
- func (l *Loader) Admit(repoRoot string)
- 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) Claims(repoRoot string) []manifest.KSClaim
- func (l *Loader) Close()
- 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(input BuiltInput, docs []store.Child)
- 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) 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 ¶ added in v0.7.3
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 ¶ added in v0.7.3
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 ¶ added in v0.7.3
LoadDocuments prepares required invocation declarations without exposing payloads in errors.
func ParseChildren ¶ added in v0.7.3
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 ¶ added in v0.7.3
func Prepare(doc manifest.DocOccurrence, opts manifest.ParseDocOptions) (store.Child, manifest.DocOccurrence, bool)
Prepare admits one authoritative document while retaining its sanitized outcome.
func Promote ¶ added in v0.7.3
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 ¶ added in v0.7.3
func ValidateDeclarations(children []store.Declaration) error
ValidateDeclarations requires authored identity against all invocation definitions.
Types ¶
type BuiltInput ¶ added in v0.7.3
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 ¶ added in v0.7.3
type Catalog struct {
// contains filtered or unexported fields
}
Catalog borrows immutable loader facts until its owner calls Close.
func (*Catalog) CatalogObject ¶ added in v0.7.3
func (c *Catalog) CatalogObject(id manifest.NamedResource) manifest.BaseManifest
CatalogObject borrows the declaration with its effective identity.
func (*Catalog) Close ¶ added in v0.7.3
func (c *Catalog) Close()
Close releases borrowed catalog storage and is safe to repeat.
func (*Catalog) RootEvidence ¶ added in v0.7.3
func (c *Catalog) RootEvidence(id manifest.NamedResource, reads *store.ReadSet) selection.RootEvidence
RootEvidence captures current support without retaining the supplied read set.
func (*Catalog) SourceExternal ¶ added in v0.7.3
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 ¶ added in v0.7.3
func (l *Loader) AdmissionCandidate(id manifest.NamedResource) store.Child
AdmissionCandidate borrows the immutable declaration prepared during construction.
func (*Loader) Admit ¶ added in v0.7.3
Admit resolves scope evidence and publishes independently runnable discovery roots.
func (*Loader) AdmitDeclarations ¶ added in v0.7.3
func (l *Loader) AdmitDeclarations(children []store.Declaration)
AdmitDeclarations retains pathless reference evidence before repository discovery.
func (*Loader) BuiltChildren ¶ added in v0.7.3
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 ¶ added in v0.7.3
func (l *Loader) CatalogObject(id manifest.NamedResource) manifest.BaseManifest
CatalogObject returns immutable reporting facts without hydrating or admitting the declaration.
func (*Loader) Claims ¶ added in v0.7.3
Claims reuses discovery's source-view documents while the Loader is mutable.
func (*Loader) Close ¶ added in v0.7.3
func (l *Loader) Close()
Close MUST follow every loader and catalog consumer and preserve detached result data.
func (*Loader) DetachCatalog ¶ added in v0.7.3
DetachCatalog keeps borrowed catalog facts alive beyond Loader.Close.
func (*Loader) EntryFailure ¶ added in v0.7.3
EntryFailure assesses retained failures admitted as unowned native entry resources.
func (*Loader) EntryFrontier ¶ added in v0.7.3
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 ¶ added in v0.7.3
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 ¶ added in v0.7.3
FinalizeIndex freezes source-qualified graph contributions before reconciliation.
func (*Loader) IndexedObject ¶ added in v0.7.3
func (l *Loader) IndexedObject(id manifest.NamedResource, r manifest.DiscoveryRecord) store.Child
IndexedObject returns the retained declaration under its contextual identity.
func (*Loader) IsFileIndexed ¶ added in v0.7.3
func (l *Loader) IsFileIndexed(id manifest.NamedResource) bool
IsFileIndexed reports whether source input supplies an authoritative declaration for id.
func (*Loader) Kustomizations ¶ added in v0.7.3
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 ¶ added in v0.7.3
func (l *Loader) Occurrence(id manifest.NamedResource) (selection.OccurrenceFacts, bool)
Occurrence borrows exact declaration coordinates and immutable parsed facts.
func (*Loader) OccurrenceClaims ¶ added in v0.7.3
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 ¶ added in v0.7.3
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 ¶ added in v0.7.3
func (l *Loader) OccurrenceRoots(id manifest.NamedResource) (manifest.NamedResource, []string)
OccurrenceRoots borrows the parsed render paths in the effective source namespace.
func (*Loader) Occurrences ¶ added in v0.7.3
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 ¶ added in v0.7.3
func (l *Loader) Packages(ctx context.Context) ([]PackageEvidence, error)
Packages snapshots resource graph inputs already traversed by Load.
func (*Loader) ParsedInputs ¶ added in v0.7.3
func (l *Loader) ParsedInputs() *ParsedInputs
ParsedInputs snapshots parsed bodies without retaining entry admission state.
func (*Loader) PathObjects ¶ added in v0.7.3
func (l *Loader) PathObjects() []selection.OccurrenceFacts
PathObjects returns live path witnesses, retaining occurrences until construction completes.
func (*Loader) PersistInputs ¶ added in v0.7.3
PersistInputs publishes only content-certified authored facts through the cache owner.
func (*Loader) PreparedObject ¶ added in v0.7.3
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 ¶ added in v0.7.3
func (l *Loader) ProducerFacts(object manifest.BaseManifest) selection.ProducerFacts
ProducerFacts reuses immutable projections across concurrent preparations.
func (*Loader) PromoteOrphans ¶ added in v0.7.3
PromoteOrphans MUST run after index finalization.
func (*Loader) PromotionDocuments ¶ added in v0.7.3
func (l *Loader) PromotionDocuments(id manifest.NamedResource) []store.Child
PromotionDocuments returns the immutable indexed batch used to promote id.
func (*Loader) ReferenceFacts ¶ added in v0.7.3
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 ¶ added in v0.7.3
References yields immutable authored reference evidence without hydrating its declaration.
func (*Loader) RegisterBuilt ¶ added in v0.7.3
func (l *Loader) RegisterBuilt( input BuiltInput, docs []store.Child, )
RegisterBuilt replaces package resource evidence with authoritative producer-bound documents. Documents MUST be sanitized immutable build output.
func (*Loader) ResolveRoot ¶ added in v0.7.3
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 ¶ added in v0.7.3
func (l *Loader) Retire()
Retire releases admission readers while preserving completed owners' read tracking.
func (*Loader) RootEvidence ¶ added in v0.7.3
func (l *Loader) RootEvidence(id manifest.NamedResource, reads *store.ReadSet) selection.RootEvidence
RootEvidence captures physical support without consulting selection membership.
func (*Loader) SelectionIndex ¶ added in v0.7.3
func (l *Loader) SelectionIndex() *manifest.DiscoveryIndex
SelectionIndex borrows the loader-owned census; callers must not mutate it.
func (*Loader) SourceFacts ¶ added in v0.7.3
func (l *Loader) SourceFacts(source manifest.NamedResource, reads *store.ReadSet) selection.SourceFacts
SourceFacts borrows comparison facts while capturing current source authority.
func (*Loader) Sources ¶ added in v0.7.3
Sources yields eligible immutable source-artifact evidence in unspecified order.
func (*Loader) SweepPreparations ¶ added in v0.7.3
func (l *Loader) SweepPreparations()
SweepPreparations MUST run at a serial construction or quiescent runtime boundary.
type PackageEvidence ¶ added in v0.7.3
type PackageEvidence struct {
Path string
Scans []string
Occurrences []selection.OccurrenceFacts
Independent bool
}
PackageEvidence retains package provenance and shared root admission.
type ParsedInputs ¶ added in v0.7.3
type ParsedInputs struct {
// contains filtered or unexported fields
}
ParsedInputs retains immutable parsed content from exact admitted source views.
func (*ParsedInputs) Matches ¶ added in v0.7.3
func (p *ParsedInputs) Matches(input *store.SourceArtifact) bool
Matches reports whether input owns a source view retained by these parsed facts.
type PromoteOptions ¶ added in v0.7.3
type PromoteOptions struct {
Record manifest.Production
Reads *store.ReadSet
Documents []store.Child
}
PromoteOptions binds acquisition to an exact source and captured generation.
type SourceLocation ¶ added in v0.7.3
SourceLocation binds a source path to its pin and ownership.
func SourceView ¶ added in v0.7.3
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
- children.go
- declarations.go
- entry_frontier.go
- generators.go
- ignore.go
- index.go
- inherit.go
- input_cache.go
- input_evidence.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
- resolve_root.go
- root_admission.go
- root_inventory.go
- root_owner_inventory.go
- root_support.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