Documentation
¶
Index ¶
- func FullConfigProcess(ctx context.Context, opts Options, patches []string) (*bundle.Bundle, machine.Type, error)
- func InitializeConfigBundle(opts Options) (*bundle.Bundle, error)
- func MergeFileAsPatch(rendered []byte, patchFile string) ([]byte, error)
- func NodeFileHasOverlay(patchFile string) (bool, error)
- func NormalizeTemplatePath(p string) string
- func Render(ctx context.Context, c *client.Client, opts Options) ([]byte, error)
- func SerializeConfiguration(configBundle *bundle.Bundle, machineType machine.Type) ([]byte, error)
- type Options
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 ¶
Function to initialize configuration settings
func MergeFileAsPatch ¶ added in v0.25.0
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
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
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.
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.