render

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtraAPIVersions

func ExtraAPIVersions() []string

ExtraAPIVersions are the API versions dmt adds on top of Helm's defaults so templates gating on them (VPA, cert-manager, Gateway API) render offline. Pass the result to Render via Options.ExtraAPIVersions.

Types

type Object

type Object struct {
	FilePath string
	*unstructured.Unstructured
}

Object is a single manifest produced by a strict render: the parsed Kubernetes object plus the chart-relative path of the template it came from.

func Render

func Render(ctx context.Context, namespace, releaseName string, opts Options) ([]Object, error)

Render renders the chart at opts.Path with nelm's public action.ChartRender, offline (no cluster). This is the same public entrypoint deckhouse-controller and d8-package-plugin use, so dmt renders modules the way they are actually installed. nelm parses the manifests, so callers get []Object and need no manifest splitting.

Before rendering it injects an image-resolution override (see injectImageStub) so image names dmt cannot know offline — werf-computed names, werf-defined aliases — still resolve instead of aborting the render, and removes it again afterwards.

The render is tolerant per template. A single manifest template that aborts the render — an intentional `fail`, or a `required` on a value dmt cannot supply offline — would otherwise abort the WHOLE chart and hide every other resource from the linters. Instead Render neutralizes just that one template and re-renders, so the remaining resources are still returned and linted; every neutralized template is restored before Render returns. An error that cannot be localized to a droppable manifest template (a failing partial, a values/schema error) is a genuine render failure and is surfaced to the caller.

type Options

type Options struct {
	// Path is the chart directory to render.
	Path string
	// Values is the .Values tree fed to the chart (not the full render context —
	// action.ChartRender builds .Release/.Capabilities itself).
	Values map[string]any
	// ExtraAPIVersions extends .Capabilities.APIVersions (e.g. VPA, cert-manager,
	// gateway kinds) so templates gating on them render offline.
	ExtraAPIVersions []string
	// OnDrop, if set, is called once for each template the tolerant render had to
	// neutralize to make the chart render: templatePath is the chart-relative path
	// (e.g. "templates/postgres.yaml") and renderErr is the abort that caused the
	// drop. Linting callers use it to surface a warning; others may leave it nil.
	OnDrop func(templatePath, renderErr string)
}

Options configures Render.

Jump to

Keyboard shortcuts

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