build

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package build resolves a validated config's datasources into concrete artifacts under .nelmwave/: merged per-release values and copied store files. It runs during `nelmwave build`, after config validation and plan projection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Artifacts

func Artifacts(ctx context.Context, cfg *config.Config, p *plan.Plan, baseDir, outDir string, logger *zap.Logger) error

Artifacts resolves values and store files for every release in p, writing them under outDir and recording each release's merged values path in p.Releases[...].ValuesFile. Datasource references resolve relative to baseDir.

Global values/labels are applied earlier via confijer type-defaults, so each release's Values already carry any inherited defaults.

Within a release, stores are resolved first, then values. Each resolved artifact is registered as a gomplate datasource ("stores/<name>" or "values/<name>") so a later *.tpl artifact can pull an earlier one via ds/include. Ordering is backward-only: an item sees only artifacts resolved before it, within the same release.

Resolution is sequential, and has to be: gomplate v5 records every render in a package-level Metrics struct without synchronisation, so concurrent Render calls crash with "concurrent map writes" (gomplate/v5@v5.2.0 render.go:226). Releases are otherwise independent and would parallelise cleanly — revisit this once gomplate is safe for concurrent use.

func Charts

func Charts(p *plan.Plan, baseDir, outDir string, logger *zap.Logger) error

Charts puts every chart the plan names into outDir/charts/ and records it in the release's ChartFile. Once that field is set, up/down/diff load the chart from the build directory and reach for nothing else — which is the point: build where the charts are, apply where they are not.

Remote charts are downloaded; a chart already given as a local path is copied in as it is. Both end up in the same place, so the build directory is the whole story either way and there is no second rule to remember. Local paths are resolved relative to the manifest, like values and stores are.

Charts are keyed by chart, not by release, so releases sharing one share a single copy. The directory is rebuilt from scratch on every run — a chart dropped from the manifest leaves nothing behind, an edited local chart is picked up, and a floating version constraint is re-resolved rather than pinned by an old build.

Types

This section is empty.

Jump to

Keyboard shortcuts

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