resourceset

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package resourceset reconciles flux-operator ResourceSets as first-class DAG nodes: wait on dependsOn / inputsFrom RSIPs / the structural parent KS, render the RS via the resourceset package, and emit every child through the standard two-pass emit path. A RS with a selector-only inputsFrom (no nameable RSIP to park on) asks the scheduler to re-run it at the structural fixpoint so it expands against the now-complete RSIP set.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	*base.Controller

	// WipeSecrets controls whether Secret cleartext is wiped when parsing
	// emitted children (forwarded to emit.Children).
	WipeSecrets bool
	// contains filtered or unexported fields
}

Controller orchestrates ResourceSet reconciliation. Reconcile-shaping state (Filter, ParentOf, …) flows in via Configure exactly once before Start — the same "config is read-only after Start" invariant the KS and HR controllers carry, encoded in the embedded *base.Controller.

func New

func New(s *store.Store, t *task.Service, wipeSecrets bool) *Controller

New constructs a ResourceSet controller.

func (*Controller) Configure

func (c *Controller) Configure(opts Options)

Configure installs the post-bootstrap state. Panics if called after Start — encodes the invariant that reconcile-shaping config is read-only once the controller is dispatching.

func (*Controller) ReconcileNode

func (c *Controller) ReconcileNode(ctx context.Context, id manifest.NamedResource, drainLevel int) []manifest.NamedResource

ReconcileNode runs id's reconcile under the dag engine, returning the blocked dependency set (nil = terminalized) and whether id ended Ready. The orchestrator's scheduler Dispatcher calls this for ResourceSet nodes. A ResourceSet has no Suspend field, so the suspended predicate is always false.

func (*Controller) Start

func (c *Controller) Start(_ context.Context)

Start wires lifecycle state. The scheduler owns dispatch (via ReconcileNode) and the orchestrator's dagrun wires its own wake listeners, so Start registers no dispatch listener of its own.

func (*Controller) WantsDrainRerun

func (c *Controller) WantsDrainRerun(id manifest.NamedResource) bool

WantsDrainRerun reports whether the ResourceSet id has a selector-only inputsFrom (ref.Name == "") — the case where its matching RSIPs may be emitted by an unknown producer, so it has no nameable dependency to park on. Such a RS asks the scheduler to re-run it at the structural fixpoint (it is wired as the scheduler's rerun-at-drain predicate) so it re-expands against the now-complete RSIP set. Returns false when id is not a RS in the store.

type Options

type Options struct {
	base.Options
	RawSink RawSink
}

Options carries the post-bootstrap state the orchestrator wires onto the controller before Start. base.Options holds the config common to every render controller (Filter / ParentOf — here gating the RS render on its structural parent KS, which may re-emit the RS with a substituted name/namespace — RenderTracker / Existence / PreflightFailure); RawSink is ResourceSet-specific.

type RawSink

type RawSink func(owner, parentKS manifest.NamedResource, doc map[string]any)

RawSink receives every non-Flux (RawObject) child a ResourceSet emits: the emitting RS (owner), the RS's structural-parent Kustomization (the grouping key), and the rendered doc. The orchestrator installs it to reproduce the legacy post-run output grouping — RS RawObject children surface under their parent KS in `flate build` output — using owner for deterministic cross-RS dedup. Nil is fine — no-op.

Jump to

Keyboard shortcuts

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