Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoveredPath ¶
type DiscoveredPath struct {
// Path relative to BaseDir (or the repo root if BaseDir is empty).
Path string
// BaseDir is the root directory for Path resolution.
// If empty, Path is resolved against the main repo root.
BaseDir string
// Namespace overrides the namespace for all namespace-scoped resources
// rendered from this path (e.g. Flux Kustomization spec.targetNamespace).
Namespace string
// Producer describes the Flux object or path that caused this path to be rendered.
Producer string
// Substitutions contains Flux postBuild inline substitutions for this path.
Substitutions map[string]string
}
DiscoveredPath represents a path to render, optionally relative to a different base directory (e.g. a cloned GitRepository).
type DiscoveryRunner ¶
type DiscoveryRunner struct {
Expanders *Registry
PathKey PathKeyFunc
RenderPath RenderPathFunc
MaxIterations int
}
DiscoveryRunner repeatedly renders discovered paths and expands the resulting resource set until Flux discovery reaches a fixed point.
func (DiscoveryRunner) Run ¶
func (r DiscoveryRunner) Run(ctx context.Context, resources *render.Render, initial []DiscoveredPath) (*ExpandResult, error)
Run renders initial and discovered paths, accumulating non-fatal expansion errors.
type ExpandResult ¶
type ExpandResult struct {
// Resources contains additional resources produced by the expander.
Resources resmap.ResMap
// DiscoveredPaths contains new paths that should be rendered.
DiscoveredPaths []DiscoveredPath
// Errors contains non-fatal errors encountered during expansion
// (e.g. a HelmRelease whose chart could not be resolved).
// These do not stop expansion but should be surfaced to the user.
Errors []error
// DeferredErrors contains unresolved dependencies that may be discovered in
// later iterations. Expanders must recompute these on every call; discovery
// promotes only those remaining at the fixed point to Errors.
DeferredErrors []error
}
ExpandResult holds the output of an expander.
type PathKeyFunc ¶
type PathKeyFunc func(DiscoveredPath) string
PathKeyFunc returns the stable identity used to deduplicate discovered paths.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds a collection of expanders and runs them in order.
func NewRegistry ¶
NewRegistry creates a new empty expander registry.
type RenderPathFunc ¶
type RenderPathFunc func(DiscoveredPath) error
RenderPathFunc renders one discovered path into the current resource set.