helm

package
v0.8.10 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 14 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.NewGenerator()
input := &helm.GeneratorInput{
    RecipeResult:     recipeResult,
    ComponentValues:  componentValues,
    Version:          "1.0.0",
    IncludeChecksums: true,
}
output, err := generator.Generate(ctx, input, "/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{}

Generator creates per-component Helm bundles from recipe results.

func NewGenerator

func NewGenerator() *Generator

NewGenerator creates a new Helm bundle generator.

func (*Generator) Generate

func (g *Generator) Generate(ctx context.Context, input *GeneratorInput, outputDir string) (*GeneratorOutput, error)

Generate creates a per-component Helm bundle from the given input.

type GeneratorInput

type GeneratorInput 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
}

GeneratorInput contains all data needed to generate a per-component Helm bundle.

type GeneratorOutput

type GeneratorOutput struct {
	// Files contains the paths of generated files.
	Files []string

	// TotalSize is the total size of all generated files.
	TotalSize int64

	// Duration is the time taken to generate the bundle.
	Duration time.Duration

	// DeploymentSteps contains ordered deployment instructions for the user.
	DeploymentSteps []string
}

GeneratorOutput contains the result of Helm bundle generation.

Jump to

Keyboard shortcuts

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