resourceset

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 7 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 resourceset renders flux-operator ResourceSet CRs offline.

A ResourceSet is a templating CRD that emits a fixed set of Kubernetes resources across a matrix of input values. flate evaluates each spec.resources / spec.resourcesTemplate entry once per input set using slim-sprig with the `<< >>` delimiter pair (so ResourceSet templates can sit inside Helm charts without delimiter conflicts).

Supported:

  • spec.inputs (in-YAML inline inputs)
  • spec.inputsFrom with captured provider inputs evaluated before rendering.
  • spec.inputStrategy: Flatten (default) AND Permute. Permute Cartesian-products inputs across providers and scopes each under its normalized name; templates access values via `inputs.<provider>.foo`. ID generation matches upstream's adler32 scheme so renders are byte-equivalent to flux-operator output. Capped at 10000 permutations.
  • spec.steps (ordered builds with cross-step duplicate rejection)
  • spec.resources (typed JSON template list)
  • spec.resourcesTemplate (multi-document YAML string)
  • Deduplication by (API group, kind, namespace, name)

Deferred:

  • fluxcd.controlplane.io/copyFrom / convertKubeConfigFrom / checksumFrom annotations — those need live cluster data flate does not have.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(
	rs *manifest.ResourceSet,
	providers []ProviderInputs,
	admit func(any) (bool, error),
	work *manifest.WorkRecord,
) ([]manifest.DocOccurrence, []manifest.Warning, error)

Render evaluates the ResourceSet's resources or ordered steps across its input matrix and returns deduplicated, unstamped decoded documents. Controller metadata belongs to the shared emission operation. Referenced providers with no combined inputs produce no resources. admit receives borrowed canonical content before matrix/template work; true skips rendering. providers contains evaluated input records in canonical order.

Types

type ProviderInputState

type ProviderInputState uint8

ProviderInputState distinguishes evaluated content from unavailable inputs.

const (
	// ProviderInputEvaluated includes a successful empty evaluation.
	ProviderInputEvaluated ProviderInputState = iota
	// ProviderInputUnsupported identifies a provider requiring an unsupported remote API.
	ProviderInputUnsupported
	// ProviderInputUnavailable identifies unavailable credential material.
	ProviderInputUnavailable
)

type ProviderInputs

type ProviderInputs struct {
	// Declaration is the captured provider before evaluation and is excluded from content identity.
	Declaration *manifest.ResourceSetInputProvider `json:"-"`
	ID          manifest.NamedResource
	Type        string
	State       ProviderInputState
	Inputs      []map[string]any
}

ProviderInputs contains captured, evaluated inputs for one provider.

func CollectProviders

func CollectProviders(rs *manifest.ResourceSet, resolve ProviderResolver) ([]ProviderInputs, error)

CollectProviders resolves unique provider declarations in canonical order.

type ProviderResolver

ProviderResolver returns the ResourceSetInputProviders matching a single spec.inputsFrom reference at the canonical identity. Callers implement this against their object store (orchestrator) or pass nil to disable inputsFrom resolution (tests, simple cases).

func StoreResolver

func StoreResolver(s providerReader) ProviderResolver

StoreResolver resolves named or selected providers from immutable query inputs. References MUST remain immutable, and the resolver MUST be used sequentially.

Jump to

Keyboard shortcuts

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