Documentation
¶
Overview ¶
Package discovery hydrates the store, resolves local source identities, and publishes immutable discovery records, ownership claims and resource-graph readers. Source aliasing uses authored URL/ref values before parent rendering.
Index ¶
- func ValidateSourceRoots(evidence []SourceRootEvidence) error
- type Admission
- func (a *Admission) AcceptEntry(ctx context.Context, binding Binding) (Binding, error)
- func (a *Admission) AddApplication(_ *store.Store, obj manifest.BaseManifest)
- func (a *Admission) AddHistory(_ *store.Store, id manifest.NamedResource, record manifest.DiscoveryRecord)
- func (a *Admission) BindEntry(ctx context.Context, st *store.Store) (*manifest.Kustomization, Binding, error)
- func (a *Admission) EntryProducers() []manifest.NamedResource
- func (a *Admission) Input() *store.SourceArtifact
- func (a *Admission) PreparedGeneration(object manifest.BaseManifest) (store.ChildDocuments, bool, error)
- func (a *Admission) PrivateEntryOperands() []manifest.NamedResource
- func (a *Admission) Provider(id manifest.NamedResource, reads *store.ReadSet, ...) store.SourceProvider
- func (a *Admission) Publish(ctx context.Context, id manifest.NamedResource, reads *store.ReadSet, ...) (bool, error)
- func (a *Admission) Resolve(ctx context.Context, id manifest.NamedResource, object manifest.BaseManifest, ...) (store.Child, *store.SourceArtifact, bool, error)
- func (a *Admission) SourceRootEvidence() SourceRootEvidence
- func (a *Admission) Warnings(warnings []manifest.Warning) []manifest.Warning
- type Binding
- type Config
- type Entry
- type PreparedSourceRoots
- type Result
- type Session
- func (d *Session) Admission() *Admission
- func (d *Session) Advance(ctx context.Context, admission *selection.AdmissionResult) (bool, error)
- func (d *Session) Close()
- func (d *Session) CompareEntryApplications(ctx context.Context, other *Session, changes *change.Set, renderPair bool) error
- func (d *Session) Freeze(ctx context.Context) (*Result, error)
- func (d *Session) Load(ctx context.Context) (bool, error)
- func (d *Session) LookupSources() []selection.LookupSource
- func (d *Session) PendingMaterializers() []manifest.NamedResource
- func (d *Session) PendingSources() []manifest.NamedResource
- func (d *Session) Plan(ctx context.Context) ([]Entry, error)
- func (d *Session) Run(ctx context.Context) (*Result, error)
- type SourceRootEvidence
- type SourceRootStatements
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateSourceRoots ¶ added in v0.8.1
func ValidateSourceRoots(evidence []SourceRootEvidence) error
ValidateSourceRoots reduces settled evidence from all comparison sides.
Types ¶
type Admission ¶
type Admission struct {
// contains filtered or unexported fields
}
Admission retains immutable bootstrap policy for early and runtime source decisions.
func (*Admission) AcceptEntry ¶
AcceptEntry installs only a proposal whose original support remains current.
func (*Admission) AddApplication ¶
func (a *Admission) AddApplication(_ *store.Store, obj manifest.BaseManifest)
AddApplication MUST only record arrivals because store listeners cannot perform qualification.
func (*Admission) AddHistory ¶
func (a *Admission) AddHistory(_ *store.Store, id manifest.NamedResource, record manifest.DiscoveryRecord)
AddHistory MUST qualify historical declarations against current parent authority.
func (*Admission) BindEntry ¶
func (a *Admission) BindEntry(ctx context.Context, st *store.Store) (*manifest.Kustomization, Binding, error)
BindEntry proposals MUST pass loader admission before AcceptEntry.
func (*Admission) EntryProducers ¶
func (a *Admission) EntryProducers() []manifest.NamedResource
EntryProducers MUST expose only the pending ordered prefix.
func (*Admission) Input ¶ added in v0.8.1
func (a *Admission) Input() *store.SourceArtifact
Input returns the admitted checkout view at its original mount.
func (*Admission) PreparedGeneration ¶ added in v0.8.1
func (a *Admission) PreparedGeneration(object manifest.BaseManifest) (store.ChildDocuments, bool, error)
PreparedGeneration returns immutable documents. Discovery only writes at serial construction or quiescent boundaries.
func (*Admission) PrivateEntryOperands ¶ added in v0.8.1
func (a *Admission) PrivateEntryOperands() []manifest.NamedResource
PrivateEntryOperands returns physical roots that must settle before ordinary full execution.
func (*Admission) Provider ¶ added in v0.8.1
func (a *Admission) Provider( id manifest.NamedResource, reads *store.ReadSet, index *manifest.DiscoveryIndex, ) store.SourceProvider
Provider captures the same source decision for diagnostics before material exists.
func (*Admission) Publish ¶
func (a *Admission) Publish( ctx context.Context, id manifest.NamedResource, reads *store.ReadSet, accept func(store.Child) (bool, error), ) (bool, error)
Publish MUST complete acceptance before admitting a source declaration.
func (*Admission) Resolve ¶
func (a *Admission) Resolve( ctx context.Context, id manifest.NamedResource, object manifest.BaseManifest, reads *store.ReadSet, ) (store.Child, *store.SourceArtifact, bool, error)
Resolve preserves the accepted classification for a known source. A nil artifact leaves normal acquisition responsible for the source. The boolean reports whether the checkout publishes its own declaration.
func (*Admission) SourceRootEvidence ¶ added in v0.8.1
func (a *Admission) SourceRootEvidence() SourceRootEvidence
SourceRootEvidence captures accepted sources before the loader closes.
type Binding ¶
type Binding struct {
Producer, Source, Key manifest.NamedResource
SupportOwner manifest.NamedResource
Path string
Descendant string
Failure error
Entry *kustomize.EntryEvidence
Reads *store.ReadSet
// contains filtered or unexported fields
}
Binding keeps actual ownership separate from the paired entry comparison coordinate.
func (*Binding) Projection ¶ added in v0.8.1
func (b *Binding) Projection() selection.EntryIdentity
Projection borrows the immutable inventory for selection.
type Config ¶
type Config struct {
Cache *cache.Cache
Work manifest.WorkScope
// Projections shares source-free facts across concurrent Plan calls.
Projections *manifest.ProducerProjections
// Declarations contains immutable invocation references admitted before discovery.
Declarations []store.Declaration
// SourceRoots names checkout directories as [namespace/]name=dir.
SourceRoots []string
// PreparedSourceRoots retains coordinates prepared before the comparison sides split.
PreparedSourceRoots *PreparedSourceRoots
// Selection controls restricted declaration construction.
Selection selection.Request
Changes *change.Set
// Loader borrows the invocation's sole declaration loader.
Loader *loader.Loader
// Input is authoritative over a preseeded bootstrap artifact or disk admission.
Input *store.SourceArtifact
// Entry supplies immutable parsed input prepared by Plan for this admission.
Entry *Entry
// Path is the scan entry point, defaulting to the admitted input's LocalPath.
// Relative paths resolve against the working directory.
Path string
// RepoRoot is the source root that Kustomization spec.path values
// resolve against (the GitRepository artifact root). Supplied
// explicitly by SDK consumers rendering extracted trees that have no
// .git. Without an admitted bootstrap input, an empty value selects
// the repository containing Path or Path itself. A preseeded
// input retains its own coordinate. Path must sit at or under RepoRoot.
RepoRoot string
// SelfURLs are the remote URL(s) this tree represents. A user-authored
// GitRepository matching one is the cluster pulling itself: no ref or
// HEAD uses the working tree, another local ref uses a cached committed
// artifact, and unavailable refs or non-HEAD sparse/submodule options
// warn and fetch normally. SDK consumers supply these for extracted
// trees with no .git/config; empty uses the working tree's git remotes.
SelfURLs []string
// KRMIgnoreFile, when non-empty, is read in place of <Path>/.krmignore
// for the initial scan; spec.path targets followed afterwards keep
// their own per-directory .krmignore. Lets one checkout carry several
// scan scopes (e.g. .krmignore.staging / .krmignore.production) and
// pick one per run.
KRMIgnoreFile string
// Trees is required when discovered packages need a bare Kustomize build.
Trees *kustomize.TreeCache
// PrepareDocuments applies producer metadata before fingerprints and substitutions.
PrepareDocuments func(manifest.BaseManifest, []manifest.DocOccurrence)
Store *store.Store
RemoteInputs *source.HTTPInputs
RemoteRetry cache.RetryConfig
StrictSubstitutions bool
SkipKinds []string
}
Config is the input contract for Begin. Store is mandatory.
type Entry ¶
type Entry struct {
ID manifest.ClusterID
Path string
Input *store.SourceArtifact
// contains filtered or unexported fields
}
Entry keeps structural identity separate from the path used for admission.
type PreparedSourceRoots ¶ added in v0.8.1
type PreparedSourceRoots struct {
// contains filtered or unexported fields
}
PreparedSourceRoots holds immutable coordinates relative to the admitted input.
type Result ¶
type Result struct {
Binding Binding
Admission *Admission
// Admitted inputs may use a synthetic label with no corresponding directory.
RepoRoot string
Index *manifest.DiscoveryIndex
LookupFailures []manifest.NamedResource
LookupEvidence []selection.LookupFailure
// contains filtered or unexported fields
}
Result summarizes what discovery hydrated into the store.
func (*Result) Close ¶
func (r *Result) Close()
Close MUST follow task drain and every possible construction consumer.
func (*Result) Preparation ¶
func (r *Result) Preparation(id manifest.NamedResource) *kustomize.Preparation
Preparation MUST be accessed only by the matching owner after construction freezes.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session retains invocation-local declaration construction until Freeze.
func (*Session) Advance ¶
Advance MUST consume only accepted observations after admission publication.
func (*Session) Close ¶
func (d *Session) Close()
Close MUST also cover construction failure before a Result exists.
func (*Session) CompareEntryApplications ¶ added in v0.8.1
func (d *Session) CompareEntryApplications( ctx context.Context, other *Session, changes *change.Set, renderPair bool, ) error
CompareEntryApplications captures possible application changes from both declarations.
func (*Session) Freeze ¶
Freeze requires the caller to reconcile PendingSources whenever it returns no result.
func (*Session) LookupSources ¶ added in v0.8.1
func (d *Session) LookupSources() []selection.LookupSource
LookupSources borrows generated sources that can complete a restricted package lookup.
func (*Session) PendingMaterializers ¶ added in v0.8.1
func (d *Session) PendingMaterializers() []manifest.NamedResource
PendingMaterializers borrows runnable demands from the most recent Advance.
func (*Session) PendingSources ¶
func (d *Session) PendingSources() []manifest.NamedResource
PendingSources borrows the admitted identities that block material-dependent construction. The caller MUST reconcile them before resuming Load, Plan, Advance, or Freeze.
type SourceRootEvidence ¶ added in v0.8.1
type SourceRootEvidence struct {
// contains filtered or unexported fields
}
SourceRootEvidence retains only settled identities, independent of discovery lifetime.
type SourceRootStatements ¶ added in v0.8.1
type SourceRootStatements struct {
// contains filtered or unexported fields
}
SourceRootStatements holds parsed selectors and their original directories.
func ParseSourceRoots ¶ added in v0.8.1
func ParseSourceRoots(input []string) (SourceRootStatements, error)
ParseSourceRoots preserves directory text after the first equals sign.
func (SourceRootStatements) Prepare ¶ added in v0.8.1
func (s SourceRootStatements) Prepare(root string) (*PreparedSourceRoots, error)
Prepare maps absolute directories once against the invocation checkout.
Source Files
¶
- application.go
- application_receipt.go
- bootstrap.go
- bootstrap_classification.go
- bootstrap_input.go
- bootstrap_view.go
- cluster_roots.go
- cluster_routes.go
- construction.go
- discard_pinned_working_tree_files.go
- discovery.go
- entries.go
- entry_prerequisites.go
- expansion.go
- preparation.go
- qualification.go
- qualification_children.go
- qualification_generation.go
- qualification_operands.go
- qualification_scope.go
- source_roots.go