Documentation
¶
Overview ¶
Package helm provides shared Helm chart rendering utilities used by both the mirror image discovery pipeline and the BOM generator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderChart ¶
func RenderChart(ctx context.Context, input ChartInput) ([]byte, error)
RenderChart shells out to `helm template` and returns rendered YAML. OCI charts (Repository starts with "oci://") use the full URL as the chart argument with no --repo flag; HTTP charts use the bare chart name plus --repo.
Types ¶
type CLIRenderer ¶
type CLIRenderer struct{}
CLIRenderer implements Renderer by shelling out to the helm CLI binary.
func (*CLIRenderer) Render ¶
func (r *CLIRenderer) Render(ctx context.Context, input ChartInput) ([]byte, error)
Render delegates to RenderChart after verifying the helm binary is available on PATH.
type ChartInput ¶
type ChartInput struct {
// Name is the release name suffix (rendered as "release-<Name>").
Name string
// Chart is the chart name (e.g., "gpu-operator").
Chart string
// Repository is the chart repository URL (oci:// or https://).
Repository string
// Version is the pinned chart version.
Version string
// Namespace is the target Kubernetes namespace.
Namespace string
// ValuesPath is a path to a values.yaml file on disk. Empty means skip.
ValuesPath string
// Values are inline values marshaled to a temp file before rendering.
// When both ValuesPath and Values are set, both are passed via separate
// --values flags (Helm merges them, with later files winning).
Values map[string]any
// KubeVersion is passed to --kube-version. When empty,
// defaults.MirrorDefaultKubeVersion is used.
KubeVersion string
// APIVersions is passed as --api-versions entries. When nil,
// defaults.MirrorExtraAPIVersions is used.
APIVersions []string
}
ChartInput carries the parameters for a single helm template invocation.
type Renderer ¶
type Renderer interface {
Render(ctx context.Context, input ChartInput) ([]byte, error)
}
Renderer renders a Helm chart to YAML bytes. The default implementation (CLIRenderer) shells out to `helm template`; tests inject a mock that returns canned YAML without requiring the helm binary on PATH.