bundle

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MPL-2.0 Imports: 12 Imported by: 3

Documentation

Overview

Package bundle provides a set of machine configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	InitCfg         config.Provider
	ControlPlaneCfg config.Provider
	WorkerCfg       config.Provider
	TalosCfg        *clientconfig.Config
}

Bundle defines a set of machine configuration files.

func NewBundle

func NewBundle(opts ...Option) (*Bundle, error)

NewBundle returns a new bundle of configuration files.

func (*Bundle) ApplyPatches

func (bundle *Bundle) ApplyPatches(patches []configpatcher.Patch, patchControlPlane, patchWorker bool) error

ApplyPatches patches every config type with a patch.

func (*Bundle) ControlPlane

func (bundle *Bundle) ControlPlane() config.Provider

ControlPlane implements the ProviderBundle interface.

func (*Bundle) Init

func (bundle *Bundle) Init() config.Provider

Init implements the ProviderBundle interface.

func (*Bundle) Serialize

func (bundle *Bundle) Serialize(commentsFlags encoder.CommentsFlags, machineType machine.Type) ([]byte, error)

Serialize returns the config for the provided machine type as bytes.

func (*Bundle) TalosConfig

func (bundle *Bundle) TalosConfig() *clientconfig.Config

TalosConfig implements the ProviderBundle interface.

func (*Bundle) Worker

func (bundle *Bundle) Worker() config.Provider

Worker implements the ProviderBundle interface.

func (*Bundle) Write

func (bundle *Bundle) Write(outputDir string, commentsFlags encoder.CommentsFlags, types ...machine.Type) error

Write config files to output directory.

type InputOptions

type InputOptions struct {
	ClusterName string
	Endpoint    string
	KubeVersion string
	GenOptions  []generate.Option
}

InputOptions holds necessary params for generating an input.

type Option

type Option func(o *Options) error

Option controls config options specific to config bundle generation.

func WithExistingConfigs

func WithExistingConfigs(configPath string) Option

WithExistingConfigs sets the path to existing config files.

func WithInputOptions

func WithInputOptions(inputOpts *InputOptions) Option

WithInputOptions allows passing in of various params for net-new input generation.

func WithPatch

func WithPatch(patch []configpatcher.Patch) Option

WithPatch allows patching every config in a bundle with a patch.

func WithPatchControlPlane

func WithPatchControlPlane(patch []configpatcher.Patch) Option

WithPatchControlPlane allows patching init and controlplane config in a bundle with a patch.

func WithPatchWorker

func WithPatchWorker(patch []configpatcher.Patch) Option

WithPatchWorker allows patching worker config in a bundle with a patch.

func WithVerbose

func WithVerbose(verbose bool) Option

WithVerbose allows setting verbose logging.

type Options

type Options struct {
	ExistingConfigs string // path to existing config files
	Verbose         bool   // whether to write any logs during generate
	InputOptions    *InputOptions

	Patches             []configpatcher.Patch
	PatchesControlPlane []configpatcher.Patch
	PatchesWorker       []configpatcher.Patch
}

Options describes generate parameters.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns default options.

Jump to

Keyboard shortcuts

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