helm

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package helm builds the HelmClient from config: the stub (the default) or the helm binary run through a CommandRunner (exec), run through the client tier (Decorate), and adapts a HelmClient to the Renderer a Codebase renders charts with.

Index

Constants

View Source
const (
	// KindStub renders nothing (the default).
	KindStub client.Kind = "stub"

	// KindExec runs the helm binary.
	KindExec client.Kind = "exec"
)

Variables

This section is empty.

Functions

func BuildDeps added in v0.0.19

func BuildDeps(
	ctx context.Context,
	c interfaces.HelmClient,
	s *codebase.Snapshot,
	chartDir string,
) error

BuildDeps runs `helm dependency build` on chartDir through c once per snapshot s: concurrent and later callers on the same chart wait for and share the first build's result, its error included. The Renderer builds through the same key, so a chart a caller has already built is not built again before its first render.

func Decorate

func Decorate(
	base interfaces.HelmClient,
	decs decorate.Decorations,
	name string,
	opts ...client.Option,
) (interfaces.HelmClient, error)

Decorate runs every HelmClient operation of base through the client tier as the client named name. All three are repeatable: rendering and linting read, and a dependency build converges on the lock file.

func NewFromConfig

func NewFromConfig(
	ctx context.Context,
	cfg Config,
	deps Deps,
) (interfaces.HelmClient, error)

NewFromConfig builds the helm client cfg.Kind selects and runs it through the client tier. An unknown kind, or exec without a runner, is CodeInvalidInput.

func NewRenderer

NewRenderer returns the Renderer over c: each chart's dependencies are built once per snapshot before its first render, each spec renders once, and the output is parsed into objects that name their source template.

func Parse

func Parse(manifest []byte) ([]types.Object, error)

Parse splits a rendered manifest at its `---` lines into objects, skipping empty documents; each object's Source is the template named in its `# Source:` comment.

Types

type Config

type Config struct {
	// Kind selects the backend; empty means KindStub.
	Kind client.Kind `yaml:"kind" mapstructure:"kind"`

	// Name labels the client in decoration overrides, metrics, spans and logs; empty
	// uses the family name ("helm").
	Name string `yaml:"name" mapstructure:"name"`
}

Config selects the helm client.

type Deps

type Deps struct {
	// Decorations decorates the client and supplies its observability.
	decorate.Decorations

	// Runner runs helm for KindExec.
	Runner interfaces.CommandRunner

	// Root is the directory helm runs in; chart and values paths are relative to it.
	Root string
}

Deps carries the helm client's collaborators.

Directories

Path Synopsis
Package exec is the HelmClient that runs the helm binary through a CommandRunner.
Package exec is the HelmClient that runs the helm binary through a CommandRunner.
Package stub is the HelmClient that renders nothing and fetches nothing.
Package stub is the HelmClient that renders nothing and fetches nothing.

Jump to

Keyboard shortcuts

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