config

package
v2.0.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWebUIListenAddress = ":8080"
	FilePrefix                = "file://"
)
View Source
const DefaultHeader = "#cloud-config"

Variables

This section is empty.

Functions

func AddHeader

func AddHeader(header, data string) string

func FilterKeys

func FilterKeys(d []byte) ([]byte, error)

FilterKeys is used to pass to any other pkg which might want to see which part of the config matches the Kairos config.

func FromString

func FromString(s string, o interface{}) error

func HasHeader

func HasHeader(userdata, head string) (bool, string)

func MergeYAML

func MergeYAML(objs ...interface{}) ([]byte, error)

func SaveCloudConfig

func SaveCloudConfig(name Stage, yc yip.YipConfig) error

Types

type Bundle

type Bundle struct {
	Repository string   `yaml:"repository,omitempty"`
	Rootfs     string   `yaml:"rootfs_path,omitempty"`
	DB         string   `yaml:"db_path,omitempty"`
	LocalFile  bool     `yaml:"local_file,omitempty"`
	Targets    []string `yaml:"targets,omitempty"`
}

type Bundles

type Bundles []Bundle

func (Bundles) Options

func (b Bundles) Options() (res [][]bundles.BundleOption)

type Config

type Config struct {
	Install          *Install `yaml:"install,omitempty"`
	collector.Config `yaml:"-"`
	// TODO: Remove this too?
	ConfigURL          string            `yaml:"config_url,omitempty"`
	Options            map[string]string `yaml:"options,omitempty"`
	FailOnBundleErrors bool              `yaml:"fail_on_bundles_errors,omitempty"`
	Bundles            Bundles           `yaml:"bundles,omitempty"`
	GrubOptions        map[string]string `yaml:"grub_options,omitempty"`
	Env                []string          `yaml:"env,omitempty"`
}

func Scan

func Scan(opts ...collector.Option) (c *Config, err error)

func (Config) HasConfigURL

func (c Config) HasConfigURL() bool

HasConfigURL returns true if ConfigURL has been set and false if it's empty.

type Install

type Install struct {
	Auto                   bool              `yaml:"auto,omitempty"`
	Reboot                 bool              `yaml:"reboot,omitempty"`
	Device                 string            `yaml:"device,omitempty"`
	Poweroff               bool              `yaml:"poweroff,omitempty"`
	GrubOptions            map[string]string `yaml:"grub_options,omitempty"`
	Bundles                Bundles           `yaml:"bundles,omitempty"`
	Encrypt                []string          `yaml:"encrypted_partitions,omitempty"`
	SkipEncryptCopyPlugins bool              `yaml:"skip_copy_kcrypt_plugin,omitempty"`
	Env                    []string          `yaml:"env,omitempty"`
	Image                  string            `yaml:"image,omitempty"`
	EphemeralMounts        []string          `yaml:"ephemeral_mounts,omitempty"`
	BindMounts             []string          `yaml:"bind_mounts,omitempty"`
}

type Stage

type Stage string
const (
	NetworkStage Stage = "network"
)

func (Stage) String

func (n Stage) String() string

Directories

Path Synopsis
Package configcollector can be used to merge configuration from different sources into one YAML.
Package configcollector can be used to merge configuration from different sources into one YAML.

Jump to

Keyboard shortcuts

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