depwait

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package depwait resolves a controller's NamedResource dependencies for the dag scheduler: Classify decides, WITHOUT blocking, whether each dep is Ready, terminally Failed, or still blocked (parkable). The shared readiness predicates (readyNow, the ReadyExpr evaluator, discovery-record promotion) live here so the gate semantics are single-sourced.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classification added in v0.3.4

type Classification struct {
	Kind    schedule.Kind
	Subject *manifest.DiagnosticIdentity
	Message string
	Causes  []manifest.DiagnosticReason
	Err     error
}

Classification retains one dependency's readiness decision. Successful decisions MUST not carry an expanded DiagnosticReason.

func (Classification) DiagnosticReason added in v0.7.3

DiagnosticReason returns captured failure context for the raw dependency id. id MUST be the raw dependency passed to Classify.

type DataDependency added in v0.7.3

type DataDependency struct {
	manifest.DependencyRef

	Input        store.ReferenceFacts
	Optional     bool
	AllowMissing bool
}

DataDependency retains a values reference and its captured availability policy.

type ErrBlocked added in v0.3.4

type ErrBlocked struct {
	Deps []manifest.NamedResource
}

ErrBlocked retains unresolved dependency identities for structural classification. It MUST remain separate from user-facing failure sentinels.

func (*ErrBlocked) Error added in v0.3.4

func (e *ErrBlocked) Error() string

type ExistenceLookup

type ExistenceLookup interface {
	// IsFileIndexed reports whether id has a raw-file discovery record.
	IsFileIndexed(id manifest.NamedResource) bool
	// Promote attempts to materialize id into the Store from the
	// discovery index. Returns true when promotion succeeded
	// and id is now reachable via store.GetObject.
	Promote(context.Context, selection.PrepareRequest, manifest.NamedResource) (bool, error)
}

ExistenceLookup is the seam Classify uses to resolve missing dependencies. Bundled into one interface so the orchestrator (and any future embedder) wires a single object through the controller Options pipe instead of two parallel closures.

The orchestrator's implementation reads from the loader's discovery index — file-indexed objects (CMs/Secrets/HRs the discovery loader kept out of the Store) get lazy-promoted the moment a depwait edge needs them, while render-only ids (no file record) stay absent until a parent render's emitRenderedChildren chain produces them.

type Waiter

type Waiter struct {
	Preparation **selection.Preparation
	Store       stateReader
	Parent      manifest.NamedResource

	// Materializer requires readiness even for existence-only dependency kinds.
	Materializer bool

	// AllowMissingCRDs accepts CRD dependencies absent from the offline inputs
	// because the cluster installs them at runtime.
	AllowMissingCRDs bool

	// Existence, when non-nil, lets Classify lazy-promote a missing dep
	// from the loader's discovery records before deciding it is
	// absent. The orchestrator wires this against the discovery index;
	// tests supply stubs. When nil, an absent dep is simply absent.
	//
	// See ExistenceLookup for the decision matrix.
	Existence ExistenceLookup
}

Waiter holds the parameters for one dependency-classification operation.

func (*Waiter) Available added in v0.7.3

func (w *Waiter) Available(ctx context.Context, dep DataDependency, level manifest.DrainLevel) availability

Available waits for offline materializers without making their failure a required cause.

func (*Waiter) Classify added in v0.3.4

Classify resolves readiness and required content from one captured snapshot.

Jump to

Keyboard shortcuts

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