helm

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package helm generates per-component Helm bundles from recipe results.

Generates a directory per component with individual values and install instructions:

  • <component>/values.yaml: Helm values per component
  • <component>/README.md: Component install/upgrade/uninstall
  • <component>/manifests/: Optional manifest files
  • README.md: Root deployment guide with ordered steps
  • deploy.sh: Automation script (0755)
  • checksums.txt: SHA256 digests for verification (optional)

Usage:

generator := &helm.Generator{
    RecipeResult:     recipeResult,
    ComponentValues:  componentValues,
    Version:          "1.0.0",
    IncludeChecksums: true,
}
output, err := generator.Generate(ctx, "/path/to/output")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentData

type ComponentData struct {
	Name         string
	Namespace    string
	Repository   string
	ChartName    string
	Version      string // Original version string (preserves 'v' prefix) for helm install --version
	ChartVersion string // Normalized version (no 'v' prefix) for chart metadata labels
	HasManifests bool
	HasChart     bool
	IsOCI        bool
	IsKustomize  bool   // True when the component uses Kustomize instead of Helm
	Tag          string // Git ref for Kustomize components (tag, branch, or commit)
	Path         string // Path within the repository to the kustomization
}

ComponentData contains data for rendering per-component templates.

type Generator

type Generator struct {
	// RecipeResult contains the recipe metadata and component references.
	RecipeResult *recipe.RecipeResult

	// ComponentValues maps component names to their values.
	// These are collected from individual bundlers.
	ComponentValues map[string]map[string]any

	// Version is the bundler version (from CLI/bundler version).
	Version string

	// IncludeChecksums indicates whether to generate a checksums.txt file.
	IncludeChecksums bool

	// ComponentManifests maps component name → manifest path → content.
	// Each component's manifests are placed in its own manifests/ subdirectory.
	ComponentManifests map[string]map[string][]byte

	// DataFiles lists additional file paths (relative to output dir) to include
	// in checksum generation. Used for external data files copied into the bundle.
	DataFiles []string

	// DynamicValues maps component names to their dynamic value paths.
	// These paths are removed from values.yaml and written to cluster-values.yaml.
	DynamicValues map[string][]string
}

Generator creates per-component Helm bundles from recipe results. Configure it with the required fields, then call Generate.

func (*Generator) Generate

func (g *Generator) Generate(ctx context.Context, outputDir string) (*deployer.Output, error)

Generate creates a per-component Helm bundle from the configured generator fields.

Jump to

Keyboard shortcuts

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