flate

module
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

README

flate

Preview the Kubernetes YAML from your Flux repository without a running cluster.

CI Release Discord

Use flate to see what a pull request changes and catch render errors before deployment. It runs as one executable and fetches sources as needed.

Install

Method How to install
Download Get the archive for your system from GitHub Releases.
Homebrew brew install --cask home-operations/tap/flate
Go go install github.com/home-operations/flate/cmd/flate@latest
Docker docker pull ghcr.io/home-operations/flate:latest

Quick start

Run these commands from the root of your Flux repository.

flate build # Print the rendered YAML
flate diff  # Show what changed in the rendered YAML
flate test  # Report render errors and exit with status 1 if any occur
flate get   # List Flux resources

Use -p to choose a directory. Use flate <command> --help to see the flags, defaults, and output formats.

Common tasks

Task Command
Compare with main and format the diff for a GitHub comment flate diff --base main -o github
Render one HelmRelease and its dependencies flate build hr demo -n apps
Render resources affected by changes from main flate build --base main
List container images flate get images
Supply values and other objects that a render needs flate build --supply ./offline-inputs.yaml
Reuse downloaded sources and rendered output across runs flate build --cache-dir ~/.cache/flate

Use --base to compare with a Git revision. Use --path-orig to compare with another directory. If you omit both flags, flate diff looks for a Git revision to compare against.

GitHub Actions and pre-commit

Add these steps to your GitHub Actions job after checkout. See the action documentation for version and cache configuration.

- uses: home-operations/flate/action@v0.7.0
- run: flate test

To run the same test before each commit, add this hook to .pre-commit-config.yaml.

repos:
  - repo: https://github.com/home-operations/flate
    rev: v0.7.0
    hooks:
      - id: flate

What flate supports

  • Renders Flux Kustomizations, HelmReleases, and ResourceSets.
  • Fetches content from GitRepository, OCIRepository, HelmRepository, HelmChart, and Bucket sources.
  • Builds artifacts with ArtifactGenerator and reads them through ExternalArtifact.
Differences from a live cluster
  • flate treats SOPS-encrypted keys as missing. Use --supply to provide dummy values or other missing inputs. Referenced values can appear in the rendered YAML.
  • Some ResourceSet input providers need saved inputs when they run without a cluster.
  • Flux uses an ArtifactGenerator's spec.serviceAccountName to select credentials in the cluster. flate renders offline without impersonating that account.
  • flate renders the Namespaces that an ArtifactGenerator currently targets. Flux uses spec.managedNamespaces.prune to control live deletion.
  • Private sources need credentials from your repository, supplied objects, or the machine that runs flate.
  • Helm renders each release as a new install. Use --kube-version and --api-versions to match the target cluster.
  • flate skips Git and OCI signature checks.
  • By default, flate omits Secrets and CustomResourceDefinitions from the output.
Source roots

If Flux publishes a source from a checkout subdirectory, use --source-root [namespace/]name=dir. Repeat the flag to name more sources. On Linux and macOS, FLATE_SOURCE_ROOT separates entries with a colon (:). If an entry contains a colon, pass it with --source-root. Explicit flags replace the environment list.

Go library

Use pkg/orchestrator to render and read results. Use pkg/manifest for resource types and identities.

If a render returns a non-nil run, call Close after you finish using its results, even if the render returns an error.

Help and license

Ask questions on Discord. Report bugs or request features in GitHub Issues.

flate uses the AGPL-3.0 license. Its behavior and test fixtures draw on flux-local, which uses the Apache-2.0 license.

Directories

Path Synopsis
cmd
flate command
flate — local validator for Flux GitOps repositories.
flate — local validator for Flux GitOps repositories.
internal
cli
Package cli wires flate's command-line interface using cobra.
Package cli wires flate's command-line interface using cobra.
cli/output
Package output owns serialization and terminal presentation of prepared values.
Package output owns serialization and terminal presentation of prepared values.
cli/testrunner
Package testrunner classifies completed reconcile results for flate test.
Package testrunner classifies completed reconcile results for flate test.
core/application
Package application screens content for possible entry applications.
Package application screens content for possible entry applications.
core/artifactsyntax
Package artifactsyntax parses ArtifactGenerator selectors and capture templates.
Package artifactsyntax parses ArtifactGenerator selectors and capture templates.
core/keylock
Package keylock provides per-key mutual-exclusion locks that honor context cancellation.
Package keylock provides per-key mutual-exclusion locks that honor context cancellation.
core/kustpath
Package kustpath resolves lexical discovery references.
Package kustpath resolves lexical discovery references.
core/referencerole
Package referencerole gives the input cache access to private manifest reference roles.
Package referencerole gives the input cache access to private manifest reference roles.
core/resourcesetinput
Package resourcesetinput owns ResourceSet input composition and template evaluation.
Package resourcesetinput owns ResourceSet input composition and template evaluation.
engine/baseline
Package baseline resolves one base revision and admits lazy input views.
Package baseline resolves one base revision and admits lazy input views.
engine/change
Package change computes file-level differences between two filesystem trees and maps them onto the Flux resources they affect.
Package change computes file-level differences between two filesystem trees and maps them onto the Flux resources they affect.
engine/change/inputprojection
Package inputprojection binds transient content evidence to immutable data inputs.
Package inputprojection binds transient content evidence to immutable data inputs.
engine/controllers/artifactgenerator
Package artifactgenerator evaluates ArtifactGenerators and publishes their outputs.
Package artifactgenerator evaluates ArtifactGenerators and publishes their outputs.
engine/controllers/base
Package base owns shared controller lifecycle, execution acceptance and publication.
Package base owns shared controller lifecycle, execution acceptance and publication.
engine/controllers/helmrelease
Package helmrelease implements the HelmReleaseController.
Package helmrelease implements the HelmReleaseController.
engine/controllers/kustomization
Package kustomization reconciles Flux Kustomizations: wait on dependsOn / sourceRef / structural parent, resolve postBuild substitutions, run the kustomize SDK, parse the result back into the Store, and publish an Emission.
Package kustomization reconciles Flux Kustomizations: wait on dependsOn / sourceRef / structural parent, resolve postBuild substitutions, run the kustomize SDK, parse the result back into the Store, and publish an Emission.
engine/controllers/resourceset
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 shared emission transaction.
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 shared emission transaction.
engine/controllers/source
Package source reconciles Flux source CRs (GitRepository, OCIRepository, Bucket, ExternalArtifact, HelmRepository) into on-disk artifacts via per-kind Fetcher implementations from internal/engine/source, then publishes the result to the Store.
Package source reconciles Flux source CRs (GitRepository, OCIRepository, Bucket, ExternalArtifact, HelmRepository) into on-disk artifacts via per-kind Fetcher implementations from internal/engine/source, then publishes the result to the Store.
engine/depwait
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).
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).
engine/diff
Package diff compares groups of rendered Kubernetes manifests.
Package diff compares groups of rendered Kubernetes manifests.
engine/discovery
Package discovery hydrates the store, resolves local source identities, and publishes immutable discovery records, ownership claims and resource-graph readers.
Package discovery hydrates the store, resolves local source identities, and publishes immutable discovery records, ownership claims and resource-graph readers.
engine/helm
Package helm wraps helm.sh/helm/v4 to render HelmReleases without shelling out to the `helm` binary.
Package helm wraps helm.sh/helm/v4 to render HelmReleases without shelling out to the `helm` binary.
engine/helm/chartinput
Package chartinput enumerates regular files under Helm's input policies.
Package chartinput enumerates regular files under Helm's input policies.
engine/helm/deterministic
Package deterministic provides drop-in replacements for the nondeterministic functions Helm exposes to chart templates through sprig — the time-, crypto/rand-, and math/rand-backed ones (now, randAlphaNum, shuffle, genCA, …) — so flate renders byte-identically run to run.
Package deterministic provides drop-in replacements for the nondeterministic functions Helm exposes to chart templates through sprig — the time-, crypto/rand-, and math/rand-backed ones (now, randAlphaNum, shuffle, genCA, …) — so flate renders byte-identically run to run.
engine/image
Package image discovers declared image fields and full tagged or digested references in rendered manifests using distribution/reference.
Package image discovers declared image fields and full tagged or digested references in rendered manifests using distribution/reference.
engine/image/imageutil
Package imageutil collects image references from prepared document batches.
Package imageutil collects image references from prepared document batches.
engine/kustomize
Package kustomize wraps sigs.k8s.io/kustomize/api so the rest of flate never invokes the `kustomize` CLI.
Package kustomize wraps sigs.k8s.io/kustomize/api so the rest of flate never invokes the `kustomize` CLI.
engine/kustomize/krusty
Package krusty coordinates access to krusty's process-global schema and plugins.
Package krusty coordinates access to krusty's process-global schema and plugins.
engine/kustomize/kustomizeinput
Package kustomizeinput classifies Kustomize's direct file and configuration inputs.
Package kustomizeinput classifies Kustomize's direct file and configuration inputs.
engine/kustomize/patch
Package patch applies Flux patches to an already constructed document set.
Package patch applies Flux patches to an already constructed document set.
engine/loader
Package loader hydrates a Store from Flux source filesystems.
Package loader hydrates a Store from Flux source filesystems.
engine/orchestrator
Package orchestrator owns rendering and the resources of each invocation.
Package orchestrator owns rendering and the resources of each invocation.
engine/resourceset
Package resourceset renders flux-operator ResourceSet CRs offline.
Package resourceset renders flux-operator ResourceSet CRs offline.
engine/schedule
Package schedule drives bounded reconciliation to a structural input fixpoint.
Package schedule drives bounded reconciliation to a structural input fixpoint.
engine/selection
Package selection owns render membership.
Package selection owns render membership.
engine/source
Package source defines SDK contracts and shared helpers for Flux sources.
Package source defines SDK contracts and shared helpers for Flux sources.
engine/source/bucket
Package bucket implements the source.Fetcher for KindBucket (S3-compatible object storage via minio-go).
Package bucket implements the source.Fetcher for KindBucket (S3-compatible object storage via minio-go).
engine/source/cache
Package cache acquires verified source bytes into immutable memory or OCI-backed filesystems.
Package cache acquires verified source bytes into immutable memory or OCI-backed filesystems.
engine/source/external
Package external reports standalone ExternalArtifacts without accepted content.
Package external reports standalone ExternalArtifacts without accepted content.
engine/source/fetcherr
Package fetcherr describes transport failure facts shared by acquisition edges.
Package fetcherr describes transport failure facts shared by acquisition edges.
engine/source/git
Package git implements the source.Fetcher for KindGitRepository.
Package git implements the source.Fetcher for KindGitRepository.
engine/source/gitrepo
Package gitrepo selects and opens local Git working trees through go-git.
Package gitrepo selects and opens local Git working trees through go-git.
engine/source/gittree
Package gittree admits direct inputs and lazy Git tree views.
Package gittree admits direct inputs and lazy Git tree views.
engine/source/helmchart
Package helmchart resolves HelmRepository charts through the shared acquisition cache.
Package helmchart resolves HelmRepository charts through the shared acquisition cache.
engine/source/httpconditional
Package httpconditional keeps validators scoped to the original request URL.
Package httpconditional keeps validators scoped to the original request URL.
engine/source/oci
Package oci fetches verified OCI source layers through the shared acquisition cache.
Package oci fetches verified OCI source layers through the shared acquisition cache.
engine/source/safepath
Package safepath validates archive names and confines disk paths to a root.
Package safepath validates archive names and confines disk paths to a root.
engine/source/sourceignore
Package sourceignore builds Flux artifact-exclusion policy from in-tree .sourceignore files and caller-supplied spec.ignore patterns.
Package sourceignore builds Flux artifact-exclusion policy from in-tree .sourceignore files and caller-supplied spec.ignore patterns.
engine/source/ssrfguard
Package ssrfguard is an opt-in SSRF egress guard for flate's outbound source fetches.
Package ssrfguard is an opt-in SSRF egress guard for flate's outbound source fetches.
engine/store
Package store is the central, in-memory state container for the controller pipeline.
Package store is the central, in-memory state container for the controller pipeline.
engine/task
Package task provides a lightweight goroutine lifecycle manager modeled on flux-local's TaskService.
Package task provides a lightweight goroutine lifecycle manager modeled on flux-local's TaskService.
engine/tree
Package tree provides immutable, confined in-memory filesystems and private construction overlays.
Package tree provides immutable, confined in-memory filesystems and private construction overlays.
engine/values
Package values implements HelmRelease values resolution and Kustomization postBuild substitution.
Package values implements HelmRelease values resolution and Kustomization postBuild substitution.
testutil
Package testutil is shared fixture scaffolding for tests across the repo — kept minimal so each test file stays self-describing.
Package testutil is shared fixture scaffolding for tests across the repo — kept minimal so each test file stays self-describing.
testutil/admissiontest
Package admissiontest prepares execution membership for controller fixtures.
Package admissiontest prepares execution membership for controller fixtures.
testutil/assert
Package assert holds dependency-free test assertion helpers usable from any package's tests.
Package assert holds dependency-free test assertion helpers usable from any package's tests.
testutil/cachetest
Package cachetest provides constructor-injected cache fixtures.
Package cachetest provides constructor-injected cache fixtures.
testutil/controllertest
Package controllertest drives controller fixtures through their task service.
Package controllertest drives controller fixtures through their task service.
testutil/fetchtest
Package fetchtest preserves the two acquisition phases in source tests.
Package fetchtest preserves the two acquisition phases in source tests.
testutil/filtertest
Package filtertest supplies in-memory relation fixtures for selection tests.
Package filtertest supplies in-memory relation fixtures for selection tests.
testutil/networktest
Package networktest binds invocation networks to test cleanup.
Package networktest binds invocation networks to test cleanup.
testutil/testfixture
Package testfixture owns disk scenarios and their isolated repositories and caches.
Package testfixture owns disk scenarios and their isolated repositories and caches.
pkg
manifest
Package manifest defines the data model for Flux GitOps resources as observed locally in a Git repository.
Package manifest defines the data model for Flux GitOps resources as observed locally in a Git repository.
orchestrator
Package orchestrator exposes supported render inputs and completed results.
Package orchestrator exposes supported render inputs and completed results.
test
e2e/internal/harness
Package harness provides shared in-process CLI and fixture support for e2e scenarios.
Package harness provides shared in-process CLI and fixture support for e2e scenarios.

Jump to

Keyboard shortcuts

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