ignition

package
v5.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PodmanDockerTmpConfPath = "/etc/tmpfiles.d/podman-docker.conf"
	DefaultIgnitionUserName = "core"
)

Variables

This section is empty.

Functions

func BoolToPtr

func BoolToPtr(b bool) *bool

Convenience function to convert bool to ptr

func CreateReadyUnitFile

func CreateReadyUnitFile(provider define.VMType, opts *ReadyUnitOpts) (string, error)

CreateReadyUnitFile makes the ready unit to report back to the host that the system is running

func DefaultReadyUnitFile

func DefaultReadyUnitFile() parser.UnitFile

func EncodeDataURLPtr

func EncodeDataURLPtr(contents string) *string

func GetNetRecoveryFile

func GetNetRecoveryFile() string

func GetNetRecoveryUnitFile

func GetNetRecoveryUnitFile() *parser.UnitFile

func GetPodmanDockerTmpConfig

func GetPodmanDockerTmpConfig(uid int, rootful bool, newline bool) string

func IntToPtr

func IntToPtr(i int) *int

Convenience function to convert int to ptr

func SetIgnitionFile

func SetIgnitionFile(loc *define.VMFile, vmtype define.VMType, vmName, vmConfigDir string) error

SetIgnitionFile creates a new Machine File for the machine's ignition file and assigns the handle to `loc`

func StrToPtr

func StrToPtr(s string) *string

Convenience function to convert string to ptr

Types

type Clevis

type Clevis struct {
	Custom    *Custom `json:"custom,omitempty"`
	Tang      []Tang  `json:"tang,omitempty"`
	Threshold *int    `json:"threshold,omitempty"`
	Tpm2      *bool   `json:"tpm2,omitempty"`
}

type Config

type Config struct {
	Ignition Ignition `json:"ignition"`
	Passwd   Passwd   `json:"passwd,omitempty"`
	Storage  Storage  `json:"storage,omitempty"`
	Systemd  Systemd  `json:"systemd,omitempty"`
}

type Custom

type Custom struct {
	Config       string `json:"config"`
	NeedsNetwork *bool  `json:"needsNetwork,omitempty"`
	Pin          string `json:"pin"`
}

type Device

type Device string

type Directory

type Directory struct {
	Node
	DirectoryEmbedded1
}

type DirectoryEmbedded1

type DirectoryEmbedded1 struct {
	Mode *int `json:"mode,omitempty"`
}

type Disk

type Disk struct {
	Device     string      `json:"device"`
	Partitions []Partition `json:"partitions,omitempty"`
	WipeTable  *bool       `json:"wipeTable,omitempty"`
}

type Dropin

type Dropin struct {
	Contents *string `json:"contents,omitempty"`
	Name     string  `json:"name"`
}

type DynamicIgnition

type DynamicIgnition struct {
	Name       string
	Key        string
	TimeZone   string
	UID        int
	VMName     string
	VMType     define.VMType
	WritePath  string
	Cfg        Config
	Rootful    bool
	NetRecover bool
	Rosetta    bool
}

func (*DynamicIgnition) GenerateIgnitionConfig

func (ign *DynamicIgnition) GenerateIgnitionConfig() error

GenerateIgnitionConfig

func (*DynamicIgnition) Write

func (ign *DynamicIgnition) Write() error

type File

type File struct {
	Node
	FileEmbedded1
}

type FileEmbedded1

type FileEmbedded1 struct {
	Append   []Resource `json:"append,omitempty"`
	Contents Resource   `json:"contents,omitempty"`
	Mode     *int       `json:"mode,omitempty"`
}

type Filesystem

type Filesystem struct {
	Device         string             `json:"device"`
	Format         *string            `json:"format,omitempty"`
	Label          *string            `json:"label,omitempty"`
	MountOptions   []MountOption      `json:"mountOptions,omitempty"`
	Options        []FilesystemOption `json:"options,omitempty"`
	Path           *string            `json:"path,omitempty"`
	UUID           *string            `json:"uuid,omitempty"`
	WipeFilesystem *bool              `json:"wipeFilesystem,omitempty"`
}

type FilesystemOption

type FilesystemOption string

type Group

type Group string

type HTTPHeader

type HTTPHeader struct {
	Name  string  `json:"name"`
	Value *string `json:"value,omitempty"`
}

type HTTPHeaders

type HTTPHeaders []HTTPHeader

type Ignition

type Ignition struct {
	Config   IgnitionConfig `json:"config,omitempty"`
	Proxy    Proxy          `json:"proxy,omitempty"`
	Security Security       `json:"security,omitempty"`
	Timeouts Timeouts       `json:"timeouts,omitempty"`
	Version  string         `json:"version,omitempty"`
}

type IgnitionBuilder

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

func NewIgnitionBuilder

func NewIgnitionBuilder(dynamicIgnition DynamicIgnition) IgnitionBuilder

NewIgnitionBuilder generates a new IgnitionBuilder type using the base `DynamicIgnition` object

func (*IgnitionBuilder) Build

func (i *IgnitionBuilder) Build() error

Build writes the internal `DynamicIgnition` config to its write path

func (*IgnitionBuilder) BuildWithIgnitionFile

func (i *IgnitionBuilder) BuildWithIgnitionFile(ignPath string) error

BuildWithIgnitionFile copies the provided ignition file into the internal `DynamicIgnition` write path

func (*IgnitionBuilder) GenerateIgnitionConfig

func (i *IgnitionBuilder) GenerateIgnitionConfig() error

GenerateIgnitionConfig generates the ignition config

func (*IgnitionBuilder) WithFile

func (i *IgnitionBuilder) WithFile(files ...File)

WithFile adds storage files to the internal `DynamicIgnition` config

func (*IgnitionBuilder) WithUnit

func (i *IgnitionBuilder) WithUnit(units ...Unit)

WithUnit adds systemd units to the internal `DynamicIgnition` config

type IgnitionConfig

type IgnitionConfig struct {
	Merge   []Resource `json:"merge,omitempty"`
	Replace Resource   `json:"replace,omitempty"`
}
type Link struct {
	Node
	LinkEmbedded1
}

type LinkEmbedded1

type LinkEmbedded1 struct {
	Hard   *bool  `json:"hard,omitempty"`
	Target string `json:"target"`
}

type Luks

type Luks struct {
	Clevis     *Clevis      `json:"clevis,omitempty"`
	Device     *string      `json:"device,omitempty"`
	KeyFile    Resource     `json:"keyFile,omitempty"`
	Label      *string      `json:"label,omitempty"`
	Name       string       `json:"name"`
	Options    []LuksOption `json:"options,omitempty"`
	UUID       *string      `json:"uuid,omitempty"`
	WipeVolume *bool        `json:"wipeVolume,omitempty"`
}

type LuksOption

type LuksOption string

type MountOption

type MountOption string

type NoProxyItem

type NoProxyItem string

type Node

type Node struct {
	Group     NodeGroup `json:"group,omitempty"`
	Overwrite *bool     `json:"overwrite,omitempty"`
	Path      string    `json:"path"`
	User      NodeUser  `json:"user,omitempty"`
}

type NodeGroup

type NodeGroup struct {
	ID   *int    `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

func GetNodeGrp

func GetNodeGrp(grpName string) NodeGroup

type NodeUser

type NodeUser struct {
	ID   *int    `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

func GetNodeUsr

func GetNodeUsr(usrName string) NodeUser

type Partition

type Partition struct {
	GUID               *string `json:"guid,omitempty"`
	Label              *string `json:"label,omitempty"`
	Number             int     `json:"number,omitempty"`
	Resize             *bool   `json:"resize,omitempty"`
	ShouldExist        *bool   `json:"shouldExist,omitempty"`
	SizeMiB            *int    `json:"sizeMiB,omitempty"`
	StartMiB           *int    `json:"startMiB,omitempty"`
	TypeGUID           *string `json:"typeGuid,omitempty"`
	WipePartitionEntry *bool   `json:"wipePartitionEntry,omitempty"`
}

type Passwd

type Passwd struct {
	Groups []PasswdGroup `json:"groups,omitempty"`
	Users  []PasswdUser  `json:"users,omitempty"`
}

type PasswdGroup

type PasswdGroup struct {
	Gid          *int    `json:"gid,omitempty"`
	Name         string  `json:"name"`
	PasswordHash *string `json:"passwordHash,omitempty"`
	ShouldExist  *bool   `json:"shouldExist,omitempty"`
	System       *bool   `json:"system,omitempty"`
}

type PasswdUser

type PasswdUser struct {
	Gecos             *string            `json:"gecos,omitempty"`
	Groups            []Group            `json:"groups,omitempty"`
	HomeDir           *string            `json:"homeDir,omitempty"`
	Name              string             `json:"name"`
	NoCreateHome      *bool              `json:"noCreateHome,omitempty"`
	NoLogInit         *bool              `json:"noLogInit,omitempty"`
	NoUserGroup       *bool              `json:"noUserGroup,omitempty"`
	PasswordHash      *string            `json:"passwordHash,omitempty"`
	PrimaryGroup      *string            `json:"primaryGroup,omitempty"`
	SSHAuthorizedKeys []SSHAuthorizedKey `json:"sshAuthorizedKeys,omitempty"`
	Shell             *string            `json:"shell,omitempty"`
	ShouldExist       *bool              `json:"shouldExist,omitempty"`
	System            *bool              `json:"system,omitempty"`
	UID               *int               `json:"uid,omitempty"`
}

type Proxy

type Proxy struct {
	HTTPProxy  *string       `json:"httpProxy,omitempty"`
	HTTPSProxy *string       `json:"httpsProxy,omitempty"`
	NoProxy    []NoProxyItem `json:"noProxy,omitempty"`
}

type Raid

type Raid struct {
	Devices []Device     `json:"devices"`
	Level   string       `json:"level"`
	Name    string       `json:"name"`
	Options []RaidOption `json:"options,omitempty"`
	Spares  *int         `json:"spares,omitempty"`
}

type RaidOption

type RaidOption string

type ReadyUnitOpts

type ReadyUnitOpts struct {
	Port uint64
}

ReadyUnitOpts are options for creating the ready unit that reports back to podman when the system is booted

type Resource

type Resource struct {
	Compression  *string      `json:"compression,omitempty"`
	HTTPHeaders  HTTPHeaders  `json:"httpHeaders,omitempty"`
	Source       *string      `json:"source,omitempty"`
	Verification Verification `json:"verification,omitempty"`
}

type SSHAuthorizedKey

type SSHAuthorizedKey string

type Security

type Security struct {
	TLS TLS `json:"tls,omitempty"`
}

type Storage

type Storage struct {
	Directories []Directory  `json:"directories,omitempty"`
	Disks       []Disk       `json:"disks,omitempty"`
	Files       []File       `json:"files,omitempty"`
	Filesystems []Filesystem `json:"filesystems,omitempty"`
	Links       []Link       `json:"links,omitempty"`
	Luks        []Luks       `json:"luks,omitempty"`
	Raid        []Raid       `json:"raid,omitempty"`
}

type Systemd

type Systemd struct {
	Units []Unit `json:"units,omitempty"`
}

type TLS

type TLS struct {
	CertificateAuthorities []Resource `json:"certificateAuthorities,omitempty"`
}

type Tang

type Tang struct {
	Thumbprint *string `json:"thumbprint,omitempty"`
	URL        string  `json:"url,omitempty"`
}

type Timeouts

type Timeouts struct {
	HTTPResponseHeaders *int `json:"httpResponseHeaders,omitempty"`
	HTTPTotal           *int `json:"httpTotal,omitempty"`
}

type Unit

type Unit struct {
	Contents *string  `json:"contents,omitempty"`
	Dropins  []Dropin `json:"dropins,omitempty"`
	Enabled  *bool    `json:"enabled,omitempty"`
	Mask     *bool    `json:"mask,omitempty"`
	Name     string   `json:"name"`
}

type Verification

type Verification struct {
	Hash *string `json:"hash,omitempty"`
}

Jump to

Keyboard shortcuts

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