discovery

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0 Imports: 31 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 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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

func (a *Admission) AcceptEntry(ctx context.Context, binding Binding) (Binding, error)

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) 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

Resolve preserves the accepted classification for a known source. A nil artifact leaves normal acquisition responsible for the source.

func (*Admission) Warnings

func (a *Admission) Warnings() []manifest.Warning

Warnings MUST replace construction alias diagnostics after runtime publication drains.

type Binding

type Binding struct {
	Producer, Source, Key manifest.NamedResource
	Path                  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.

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
	// 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
	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 Result

type Result struct {
	Binding   Binding
	Admission *Admission
	// Admitted inputs may use a synthetic label with no corresponding directory.
	RepoRoot string
	Index    *manifest.DiscoveryIndex
	// 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 Begin

func Begin(ctx context.Context, cfg Config) (*Session, error)

Begin admits the bootstrap declaration before any material-dependent construction.

func (*Session) Admission

func (d *Session) Admission() *Admission

Admission borrows the canonical entry owner before and after Freeze.

func (*Session) Advance

func (d *Session) Advance(ctx context.Context, admission *selection.AdmissionResult) (bool, error)

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) Freeze

func (d *Session) Freeze(ctx context.Context) (*Result, error)

Freeze requires the caller to reconcile PendingSources whenever it returns no result.

func (*Session) Load

func (d *Session) Load(ctx context.Context) (bool, error)

Load resumes construction after the caller reconciles PendingSources.

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.

func (*Session) Plan

func (d *Session) Plan(ctx context.Context) ([]Entry, error)

Plan requires an isolated session and resumes after PendingSources are ready.

func (*Session) Run

func (d *Session) Run(ctx context.Context) (*Result, error)

Run requires the caller to reconcile PendingSources whenever it returns no result.

Jump to

Keyboard shortcuts

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