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
- func BuildDeps(ctx context.Context, c interfaces.HelmClient, s *codebase.Snapshot, ...) error
- func Decorate(base interfaces.HelmClient, decs decorate.Decorations, name string, ...) (interfaces.HelmClient, error)
- func NewFromConfig(ctx context.Context, cfg Config, deps Deps) (interfaces.HelmClient, error)
- func NewRenderer(c interfaces.HelmClient, s *codebase.Snapshot) interfaces.Renderer
- func Parse(manifest []byte) ([]types.Object, error)
- type Config
- type Deps
Constants ¶
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 ¶
func NewRenderer(c interfaces.HelmClient, s *codebase.Snapshot) interfaces.Renderer
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.
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. |