conf

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoState systemdUnitState = iota
	Enable
	Mask
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	// contains filtered or unexported fields
}

Conf is a configuration for a CoreOS machine. Only Ignition spec 3 and later are supported.

func (*Conf) AddAuthorizedKeys

func (c *Conf) AddAuthorizedKeys(user string, keys []string)

AddAuthorizedKeys adds an Ignition config to add the given keys to the SSH authorized_keys file for the given user.

func (*Conf) AddAutoLogin

func (c *Conf) AddAutoLogin()

AddAutoLogin adds an Ignition config for automatic login on consoles

func (*Conf) AddAutoResize

func (c *Conf) AddAutoResize()

AddAutoResize adds an Ignition config for a `resize` function to resize serial consoles

func (*Conf) AddConfigSource

func (c *Conf) AddConfigSource(source string)

AddConfigSource adds an Ignition config to merge (v3) the config available at the `source` URL with the current config.

func (*Conf) AddFile

func (c *Conf) AddFile(path, contents string, mode int)

func (*Conf) AddSystemdUnit

func (c *Conf) AddSystemdUnit(name, contents string, state systemdUnitState)

func (*Conf) AddSystemdUnitDropin

func (c *Conf) AddSystemdUnitDropin(service, name, contents string)

func (*Conf) Bytes

func (c *Conf) Bytes() []byte

Bytes returns the serialized userdata in Conf.

func (*Conf) CopyKeys

func (c *Conf) CopyKeys(keys []*agent.Key)

CopyKeys copies public keys from agent ag into the configuration to the appropriate configuration section for the core user.

func (*Conf) DisableAutomaticUpdates

func (c *Conf) DisableAutomaticUpdates()

DisableAutomaticUpdates turns off zincati

func (*Conf) IsEmpty

func (c *Conf) IsEmpty() bool

func (*Conf) IsIgnition

func (c *Conf) IsIgnition() bool

IsIgnition returns true if the config is for Ignition. Returns false in the case of empty configs

func (*Conf) MaybeCompress

func (c *Conf) MaybeCompress() (string, error)

Config is compressed and added to another via data url

func (*Conf) MergeV3

func (c *Conf) MergeV3(newConfig v3types.Config)

MergeV3 merges a config with the ignitionV3 config via Ignition's merging function.

func (*Conf) MergeV31

func (c *Conf) MergeV31(newConfig v31types.Config)

MergeV31 merges a config with the ignitionV31 config via Ignition's merging function.

func (*Conf) MergeV32

func (c *Conf) MergeV32(newConfig v32types.Config)

MergeV32 merges a config with the ignitionV32 config via Ignition's merging function.

func (*Conf) MergeV33

func (c *Conf) MergeV33(newConfig v33types.Config)

MergeV33 merges a config with the ignitionV33 config via Ignition's merging function.

func (*Conf) MergeV34

func (c *Conf) MergeV34(newConfig v34types.Config)

MergeV34exp merges a config with the ignitionV34exp config via Ignition's merging function.

func (*Conf) MergeV35exp

func (c *Conf) MergeV35exp(newConfig v35exptypes.Config)

MergeV35exp merges a config with the ignitionV35exp config via Ignition's merging function.

func (*Conf) MountHost

func (c *Conf) MountHost(dest string, readonly bool)

MountHost adds an Ignition config to mount an folder

func (*Conf) String

func (c *Conf) String() string

String returns the string representation of the userdata in Conf.

func (*Conf) ValidConfig

func (c *Conf) ValidConfig() bool

func (*Conf) WriteFile

func (c *Conf) WriteFile(name string) error

WriteFile writes the userdata in Conf to a local file.

type UserData

type UserData struct {
	// contains filtered or unexported fields
}

UserData is an immutable, unvalidated configuration for a CoreOS machine.

func Butane

func Butane(data string) *UserData

Butane returns a Butane UserData struct from the provided string.

func Empty

func Empty() *UserData

Empty creates a completely empty configuration. Any configuration addition applied to an empty config is ignored.

func EmptyIgnition

func EmptyIgnition() *UserData

EmptyIgnition returns an a default empty config using the latest stable supported Ignition spec.

func Ignition

func Ignition(data string) *UserData

Ignition returns an Ignition UserData struct from the provided string. If the given string is empty, it will create a default empty config using the latest stable supported Ignition spec.

func MergeAllConfigs

func MergeAllConfigs(confObjs []*Conf) (*UserData, error)

Merge all configs into a V3.1 config

func Unknown

func Unknown(data string) *UserData

func (*UserData) AddKey

func (u *UserData) AddKey(key agent.Key) *UserData

AddKey adds an SSH key and returns a new UserData.

func (*UserData) Contains

func (u *UserData) Contains(substr string) bool

Contains returns true if the UserData contains the specified string.

func (*UserData) Render

func (u *UserData) Render(warnings WarningsAction) (*Conf, error)

Render parses userdata and returns a new Conf. It returns an error if the userdata can't be parsed, or if FailWarnings is selected and there are warnings.

func (*UserData) Subst

func (u *UserData) Subst(old, new string) *UserData

Subst performs a string substitution and returns a new UserData.

type WarningsAction

type WarningsAction int
const (
	IgnoreWarnings WarningsAction = iota
	ReportWarnings
	FailWarnings
)

Jump to

Keyboard shortcuts

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