engine

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FullConfigProcess

func FullConfigProcess(ctx context.Context, opts Options, patches []string) (*bundle.Bundle, machine.Type, error)

FullConfigProcess handles the full process of creating and updating the Bundle.

func InitializeConfigBundle

func InitializeConfigBundle(opts Options) (*bundle.Bundle, error)

Function to initialize configuration settings

func MergeFileAsPatch added in v0.25.0

func MergeFileAsPatch(rendered []byte, patchFile string) ([]byte, error)

MergeFileAsPatch overlays the YAML body of patchFile onto rendered using Talos's strategic-merge config patcher.

patchFile is a node file: its first line is the talm modeline (a YAML comment) followed by an arbitrary Talos config patch (typically machine.* fields the user wants pinned per node). When the file contains only the modeline (or is otherwise empty after stripping comments and whitespace) the function returns rendered unchanged — short-circuiting Talos's configpatcher which would otherwise route the empty patch through JSON6902 and reject any multi-document rendered config (the v1.12+ output format) outright.

Note that for non-empty patches the patcher round-trips rendered through its config loader, normalising YAML formatting and dropping comments. This is acceptable for the apply path (the result goes straight to ApplyConfiguration) but unsuitable for human-facing output such as `talm template` — which is why the template subcommand does not call this helper.

func NodeFileHasOverlay added in v0.25.0

func NodeFileHasOverlay(patchFile string) (bool, error)

NodeFileHasOverlay reports whether a node file carries a non-empty per-node body below its modeline. The apply path uses this to reject multi-node node files that would otherwise stamp the same pinned hostname/address/VIP onto every target.

func NormalizeTemplatePath added in v0.19.1

func NormalizeTemplatePath(p string) string

NormalizeTemplatePath converts OS-specific path separators to forward slash. Helm engine's Render() returns map keys with forward slashes regardless of OS, so input paths must be normalized to match.

func Render

func Render(ctx context.Context, c *client.Client, opts Options) ([]byte, error)

Render executes the rendering of templates based on the provided options.

func SerializeConfiguration

func SerializeConfiguration(configBundle *bundle.Bundle, machineType machine.Type) ([]byte, error)

Function for serializing the configuration

Types

type Options

type Options struct {
	ValueFiles        []string
	StringValues      []string
	Values            []string
	FileValues        []string
	JsonValues        []string
	LiteralValues     []string
	TalosVersion      string
	WithSecrets       string
	Full              bool
	Debug             bool
	Root              string
	Offline           bool
	KubernetesVersion string
	TemplateFiles     []string
	ClusterName       string
	Endpoint          string
	// CommandName names the caller subcommand for error messages such as
	// the one produced by FailIfMultiNodes. Empty value falls back to "talm".
	CommandName string
}

Options encapsulates all parameters necessary for rendering.

Directories

Path Synopsis
Package engine implements the Go text template engine as needed for Helm.
Package engine implements the Go text template engine as needed for Helm.

Jump to

Keyboard shortcuts

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