types

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GPT   = "gpt"
	BIOS  = "bios"
	MSDOS = "msdos"
	EFI   = "efi"
)

Variables

This section is empty.

Functions

func DebugLevel

func DebugLevel() log.Level

func IsDebugLevel

func IsDebugLevel(l Logger) bool

Types

type Bootloader

type Bootloader interface {
	Install(rootDir, bootDir string) (err error)
	InstallConfig(rootDir, bootDir string) error
	DoEFIEntries(shimName, efiDir string) error
	InstallEFI(rootDir, efiDir string) error
	InstallEFIBinaries(rootDir, efiDir, efiPath string) error
	SetPersistentVariables(envFile string, vars map[string]string) error
	SetDefaultEntry(partMountPoint, imgMountPoint, defaultEntry string) error
}

type BtrfsConfig

type BtrfsConfig struct{}

func NewBtrfsConfig

func NewBtrfsConfig() *BtrfsConfig

type BuildConfig

type BuildConfig struct {
	Date        bool              `yaml:"date,omitempty" mapstructure:"date"`
	Name        string            `yaml:"name,omitempty" mapstructure:"name"`
	OutDir      string            `yaml:"output,omitempty" mapstructure:"output"`
	Snapshotter SnapshotterConfig `yaml:"snapshotter,omitempty" mapstructure:"snapshotter"`

	// 'inline' and 'squash' labels ensure config fields
	// are embedded from a yaml and map PoV
	Config `yaml:",inline" mapstructure:",squash"`
}

BuildConfig represents the config we need for building isos, raw images, artifacts

func (*BuildConfig) Sanitize

func (b *BuildConfig) Sanitize() error

Sanitize checks the consistency of the struct, returns error if unsolvable inconsistencies are found

type CloudInitRunner

type CloudInitRunner interface {
	Run(string, ...string) error
	SetModifier(schema.Modifier)
	CloudInitFileRender(target string, config *schema.YipConfig) error
}

type Config

type Config struct {
	Logger                    Logger
	Fs                        FS
	Mounter                   Mounter
	Runner                    Runner
	Syscall                   SyscallInterface
	CloudInitRunner           CloudInitRunner
	ImageExtractor            ImageExtractor
	Client                    HTTPClient
	Platform                  *Platform `yaml:"platform,omitempty" mapstructure:"platform"`
	Cosign                    bool      `yaml:"cosign,omitempty" mapstructure:"cosign"`
	Verify                    bool      `yaml:"verify,omitempty" mapstructure:"verify"`
	CosignPubKey              string    `yaml:"cosign-key,omitempty" mapstructure:"cosign-key"`
	LocalImage                bool      `yaml:"local,omitempty" mapstructure:"local"`
	Arch                      string    `yaml:"arch,omitempty" mapstructure:"arch"`
	SquashFsCompressionConfig []string  `yaml:"squash-compression,omitempty" mapstructure:"squash-compression"`
	SquashFsNoCompression     bool      `yaml:"squash-no-compression,omitempty" mapstructure:"squash-no-compression"`
	CloudInitPaths            []string  `yaml:"cloud-init-paths,omitempty" mapstructure:"cloud-init-paths"`
	Strict                    bool      `yaml:"strict,omitempty" mapstructure:"strict"`
}

Config is the struct that includes basic and generic configuration of elemental binary runtime. It mostly includes the interfaces used around many methods in elemental code

func (Config) LoadInstallState

func (c Config) LoadInstallState() (*InstallState, error)

LoadInstallState loads the state.yaml file and unmarshals it to an InstallState object

func (*Config) Sanitize

func (c *Config) Sanitize() error

Sanitize checks the consistency of the struct, returns error if unsolvable inconsistencies are found

func (Config) WriteInstallState

func (c Config) WriteInstallState(i *InstallState, statePath, recoveryPath string) error

WriteInstallState writes the state.yaml file to the given state and recovery paths

type DiskSpec

type DiskSpec struct {
	Size           uint                `yaml:"size,omitempty" mapstructure:"size"`
	Partitions     ElementalPartitions `yaml:"partitions,omitempty" mapstructure:"partitions"`
	Expandable     bool                `yaml:"expandable,omitempty" mapstructure:"expandable"`
	System         *ImageSource        `yaml:"system,omitempty" mapstructure:"system"`
	RecoverySystem Image               `yaml:"recovery-system,omitempty" mapstructure:"recovery-system"`
	GrubConf       string
	CloudInit      []string `yaml:"cloud-init,omitempty" mapstructure:"cloud-init"`
	GrubDefEntry   string   `yaml:"grub-entry-name,omitempty" mapstructure:"grub-entry-name"`
	Type           string   `yaml:"type,omitempty" mapstructure:"type"`
	DeployCmd      []string `yaml:"deploy-command,omitempty" mapstructure:"deploy-command"`
}

func (DiskSpec) GetGrubLabels

func (d DiskSpec) GetGrubLabels() map[string]string

func (*DiskSpec) MinDiskSize

func (d *DiskSpec) MinDiskSize() uint

minDiskSize counts the minimum size (MB) required for the disk given the partitions setup

func (*DiskSpec) Sanitize

func (d *DiskSpec) Sanitize() error

Sanitize checks the consistency of the struct, returns error if unsolvable inconsistencies are found

type ElementalPartitions

type ElementalPartitions struct {
	BIOS       *Partition
	EFI        *Partition
	OEM        *Partition `yaml:"oem,omitempty" mapstructure:"oem"`
	Recovery   *Partition `yaml:"recovery,omitempty" mapstructure:"recovery"`
	State      *Partition `yaml:"state,omitempty" mapstructure:"state"`
	Persistent *Partition `yaml:"persistent,omitempty" mapstructure:"persistent"`
}

func NewElementalPartitionsFromList

func NewElementalPartitionsFromList(pl PartitionList, state *InstallState) ElementalPartitions

NewElementalPartitionsFromList fills an ElementalPartitions instance from given partitions list. First tries to match partitions by partition label, if not, it tries to match partitions by filesystem label

func (ElementalPartitions) GetConfigStorage

func (ep ElementalPartitions) GetConfigStorage() string

GetConfigStorage returns the path, usually a mountpoint, of the configuration partition

func (ElementalPartitions) PartitionsByInstallOrder

func (ep ElementalPartitions) PartitionsByInstallOrder(extraPartitions PartitionList, excludes ...*Partition) PartitionList

PartitionsByInstallOrder sorts partitions according to the default layout nil partitons are ignored partition with 0 size is set last

func (ElementalPartitions) PartitionsByMountPoint

func (ep ElementalPartitions) PartitionsByMountPoint(descending bool, excludes ...*Partition) PartitionList

PartitionsByMountPoint sorts partitions according to its mountpoint, ignores nil partitions or partitions with an empty mountpoint

func (*ElementalPartitions) SetFirmwarePartitions

func (ep *ElementalPartitions) SetFirmwarePartitions(firmware string, partTable string) error

SetFirmwarePartitions sets firmware partitions for a given firmware and partition table type

type EphemeralMounts

type EphemeralMounts struct {
	Type   string   `yaml:"type,omitempty" mapstructure:"type"`
	Device string   `yaml:"device,omitempty" mapstructure:"device"`
	Size   string   `yaml:"size,omitempty" mapstructure:"size"`
	Paths  []string `yaml:"paths,omitempty" mapstructure:"paths"`
}

EphemeralMounts contains information about the RW overlay mounted over the immutable system.

type FS

type FS interface {
	Chmod(name string, mode fs.FileMode) error
	Create(name string) (*os.File, error)
	Glob(pattern string) ([]string, error)
	Link(oldname, newname string) error
	Lstat(name string) (fs.FileInfo, error)
	Mkdir(name string, perm fs.FileMode) error
	Open(name string) (fs.File, error)
	OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)
	RawPath(name string) (string, error)
	ReadDir(dirname string) ([]fs.DirEntry, error)
	ReadFile(filename string) ([]byte, error)
	Readlink(name string) (string, error)
	Remove(name string) error
	RemoveAll(name string) error
	Rename(oldpath, newpath string) error
	Stat(name string) (fs.FileInfo, error)
	Symlink(oldname, newname string) error
	WriteFile(filename string, data []byte, perm fs.FileMode) error
}

type HTTPClient

type HTTPClient interface {
	GetURL(log Logger, url string, destination string) error
}

type Image

type Image struct {
	File       string
	Label      string       `yaml:"label,omitempty" mapstructure:"label"`
	Size       uint         `yaml:"size,omitempty" mapstructure:"size"`
	FS         string       `yaml:"fs,omitempty" mapstructure:"fs"`
	Source     *ImageSource `yaml:"uri,omitempty" mapstructure:"uri"`
	MountPoint string
	LoopDevice string
}

Image struct represents a file system image with its commonly configurable values, size in MiB

type ImageExtractor

type ImageExtractor interface {
	ExtractImage(imageRef, destination, platformRef string, local bool) (string, error)
}

type ImageSource

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

ImageSource represents the source from where an image is created for easy identification

func NewDirSrc

func NewDirSrc(src string) *ImageSource

func NewDockerSrc

func NewDockerSrc(src string) *ImageSource

func NewEmptySrc

func NewEmptySrc() *ImageSource

func NewFileSrc

func NewFileSrc(src string) *ImageSource

func NewSrcFromURI

func NewSrcFromURI(uri string) (*ImageSource, error)

func (*ImageSource) CustomUnmarshal

func (i *ImageSource) CustomUnmarshal(data interface{}) (bool, error)

func (ImageSource) GetDigest

func (i ImageSource) GetDigest() string

func (ImageSource) IsDir

func (i ImageSource) IsDir() bool

func (ImageSource) IsEmpty

func (i ImageSource) IsEmpty() bool

func (ImageSource) IsFile

func (i ImageSource) IsFile() bool

func (ImageSource) IsImage

func (i ImageSource) IsImage() bool

func (ImageSource) MarshalYAML

func (i ImageSource) MarshalYAML() (interface{}, error)

func (*ImageSource) SetDigest

func (i *ImageSource) SetDigest(digest string)

func (ImageSource) String

func (i ImageSource) String() string

func (*ImageSource) UnmarshalYAML

func (i *ImageSource) UnmarshalYAML(value *yaml.Node) error

func (ImageSource) Value

func (i ImageSource) Value() string

type InitSpec

type InitSpec struct {
	Mkinitrd bool `yaml:"mkinitrd,omitempty" mapstructure:"mkinitrd"`
	Force    bool `yaml:"force,omitempty" mapstructure:"force"`

	Features []string `yaml:"features,omitempty" mapstructure:"features"`
}

InitSpec struct represents all the init action details

type InstallSpec

type InstallSpec struct {
	Target           string `yaml:"target,omitempty" mapstructure:"target"`
	Firmware         string
	PartTable        string
	Partitions       ElementalPartitions `yaml:"partitions,omitempty" mapstructure:"partitions"`
	ExtraPartitions  PartitionList       `yaml:"extra-partitions,omitempty" mapstructure:"extra-partitions"`
	NoFormat         bool                `yaml:"no-format,omitempty" mapstructure:"no-format"`
	Force            bool                `yaml:"force,omitempty" mapstructure:"force"`
	CloudInit        []string            `yaml:"cloud-init,omitempty" mapstructure:"cloud-init"`
	Iso              string              `yaml:"iso,omitempty" mapstructure:"iso"`
	GrubDefEntry     string              `yaml:"grub-entry-name,omitempty" mapstructure:"grub-entry-name"`
	System           *ImageSource        `yaml:"system,omitempty" mapstructure:"system"`
	RecoverySystem   Image               `yaml:"recovery-system,omitempty" mapstructure:"recovery-system"`
	DisableBootEntry bool                `yaml:"disable-boot-entry,omitempty" mapstructure:"disable-boot-entry"`
}

InstallSpec struct represents all the installation action details

func (InstallSpec) GetGrubLabels

func (i InstallSpec) GetGrubLabels() map[string]string

func (*InstallSpec) Sanitize

func (i *InstallSpec) Sanitize() error

Sanitize checks the consistency of the struct, returns error if unsolvable inconsistencies are found

type InstallState

type InstallState struct {
	Date        string                     `yaml:"date,omitempty"`
	Partitions  map[string]*PartitionState `yaml:",omitempty,inline"`
	Snapshotter SnapshotterConfig          `yaml:"snapshotter,omitempty"`
}

InstallState tracks the installation data of the whole system

type LiveISO

type LiveISO struct {
	RootFS             []*ImageSource `yaml:"rootfs,omitempty" mapstructure:"rootfs"`
	UEFI               []*ImageSource `yaml:"uefi,omitempty" mapstructure:"uefi"`
	Image              []*ImageSource `yaml:"image,omitempty" mapstructure:"image"`
	Label              string         `yaml:"label,omitempty" mapstructure:"label"`
	GrubEntry          string         `yaml:"grub-entry-name,omitempty" mapstructure:"grub-entry-name"`
	BootloaderInRootFs bool           `yaml:"bootloader-in-rootfs" mapstructure:"bootloader-in-rootfs"`
	Firmware           string         `yaml:"firmware,omitempty" mapstructure:"firmware"`
}

LiveISO represents the configurations needed for a live ISO image

func (*LiveISO) Sanitize

func (i *LiveISO) Sanitize() error

Sanitize checks the consistency of the struct, returns error if unsolvable inconsistencies are found

type Logger

type Logger interface {
	Info(...interface{})
	Warn(...interface{})
	Debug(...interface{})
	Error(...interface{})
	Fatal(...interface{})
	Success(...interface{})
	Warning(...interface{})
	Panic(...interface{})
	Trace(...interface{})
	Infof(string, ...interface{})
	Warnf(string, ...interface{})
	Debugf(string, ...interface{})
	Errorf(string, ...interface{})
	Fatalf(string, ...interface{})
	Panicf(string, ...interface{})
	Tracef(string, ...interface{})
	SetLevel(level log.Level)
	GetLevel() log.Level
	SetOutput(writer io.Writer)
	SetFormatter(formatter log.Formatter)

	SetContext(string)
	SpinnerStop()
	Spinner()
	Ask() bool
	Screen(string)
}

Logger is the interface we want for our logger, so we can plug different ones easily

func NewBufferLogger

func NewBufferLogger(b *bytes.Buffer) Logger

NewBufferLogger will return a logger that stores all logs in a buffer, used mainly for testing

func NewLogger

func NewLogger() Logger

func NewNullLogger

func NewNullLogger() Logger

NewNullLogger will return a logger that discards all logs, used mainly for testing

type LoggerOptions

type LoggerOptions func(l Logger) error

type LoopDeviceConfig

type LoopDeviceConfig struct {
	Size uint   `yaml:"size,omitempty" mapstructure:"size"`
	FS   string `yaml:"fs,omitempty" mapstructure:"fs"`
}

func NewLoopDeviceConfig

func NewLoopDeviceConfig() *LoopDeviceConfig

type MountSpec

type MountSpec struct {
	WriteFstab bool             `yaml:"write-fstab,omitempty" mapstructure:"write-fstab"`
	Disable    bool             `yaml:"disable,omitempty" mapstructure:"disable"`
	Sysroot    string           `yaml:"sysroot,omitempty" mapstructure:"sysroot"`
	Mode       string           `yaml:"mode,omitempty" mapstructure:"mode"`
	Volumes    []*VolumeMount   `yaml:"extra-volumes,omitempty" mapstructure:"extra-volumes"`
	Ephemeral  EphemeralMounts  `yaml:"ephemeral,omitempty" mapstructure:"ephemeral"`
	Persistent PersistentMounts `yaml:"persistent,omitempty" mapstructure:"persistent"`
}

MountSpec struct represents all the mount action details

func (*MountSpec) HasPersistent

func (spec *MountSpec) HasPersistent() bool

func (*MountSpec) Sanitize

func (spec *MountSpec) Sanitize() error

Sanitize checks the consistency of the struct, returns error if unsolvable inconsistencies are found

type Mounter

type Mounter interface {
	Mount(source string, target string, fstype string, options []string) error
	Unmount(target string) error
	IsLikelyNotMountPoint(file string) (bool, error)
}

This is is just a redefinition of mount.Interface to types.Mounter types

func NewDummyMounter

func NewDummyMounter() Mounter

func NewMounter

func NewMounter(binary string) Mounter

type OCIImageExtractor

type OCIImageExtractor struct{}

func (OCIImageExtractor) ExtractImage

func (e OCIImageExtractor) ExtractImage(imageRef, destination, platformRef string, local bool) (string, error)

type Partition

type Partition struct {
	Name            string
	FilesystemLabel string   `yaml:"label,omitempty" mapstructure:"label"`
	Size            uint     `yaml:"size,omitempty" mapstructure:"size"`
	FS              string   `yaml:"fs,omitempty" mapstructure:"fs"`
	Flags           []string `yaml:"flags,omitempty" mapstructure:"flags"`
	MountPoint      string
	Path            string
	Disk            string
}

Partition struct represents a partition with its commonly configurable values, size in MiB

func (Partition) ToImage

func (p Partition) ToImage() *Image

ToImage returns an image object that matches the partition. This is helpful if the partition is managed as an image.

type PartitionList

type PartitionList []*Partition

func (PartitionList) GetByLabel

func (pl PartitionList) GetByLabel(label string) *Partition

GetByLabel gets a partition by its label from the PartitionList

func (PartitionList) GetByName

func (pl PartitionList) GetByName(name string) *Partition

GetByName gets a partitions by its name from the PartitionList

func (PartitionList) GetByNameOrLabel

func (pl PartitionList) GetByNameOrLabel(name, label string) *Partition

GetByNameOrLabel gets a partition by its name or label. It tries by name first

type PartitionState

type PartitionState struct {
	FSLabel       string               `yaml:"label,omitempty"`
	RecoveryImage *SystemState         `yaml:"recovery,omitempty"`
	Snapshots     map[int]*SystemState `yaml:"snapshots,omitempty"`
}

PartState tracks installation data of a partition

type PersistentMounts

type PersistentMounts struct {
	Mode   string      `yaml:"mode,omitempty" mapstructure:"mode"`
	Paths  []string    `yaml:"paths,omitempty" mapstructure:"paths"`
	Volume VolumeMount `yaml:"volume,omitempty" mapstructure:"volume"`
}

PersistentMounts struct contains settings for which paths to mount as persistent

type Platform

type Platform struct {
	OS         string
	Arch       string
	GolangArch string
}

func NewPlatform

func NewPlatform(os, arch string) (*Platform, error)

func NewPlatformFromArch

func NewPlatformFromArch(arch string) (*Platform, error)

func ParsePlatform

func ParsePlatform(platform string) (*Platform, error)

func (*Platform) CustomUnmarshal

func (p *Platform) CustomUnmarshal(data interface{}) (bool, error)

func (Platform) MarshalYAML

func (p Platform) MarshalYAML() (interface{}, error)

func (*Platform) String

func (p *Platform) String() string

func (*Platform) UnmarshalYAML

func (p *Platform) UnmarshalYAML(value *yaml.Node) error

type RealRunner

type RealRunner struct {
	Logger Logger
}

func (RealRunner) CommandExists

func (r RealRunner) CommandExists(command string) bool

func (RealRunner) GetLogger

func (r RealRunner) GetLogger() Logger

func (RealRunner) InitCmd

func (r RealRunner) InitCmd(command string, args ...string) *exec.Cmd

func (RealRunner) Run

func (r RealRunner) Run(command string, args ...string) ([]byte, error)

func (RealRunner) RunCmd

func (r RealRunner) RunCmd(cmd *exec.Cmd) ([]byte, error)

func (*RealRunner) SetLogger

func (r *RealRunner) SetLogger(logger Logger)

type RealSyscall

type RealSyscall struct{}

func (*RealSyscall) Chdir

func (r *RealSyscall) Chdir(path string) error

func (*RealSyscall) Chroot

func (r *RealSyscall) Chroot(path string) error

type Repository

type Repository struct {
	Name        string `yaml:"name,omitempty" mapstructure:"name"`
	Priority    int    `yaml:"priority,omitempty" mapstructure:"priority"`
	URI         string `yaml:"uri,omitempty" mapstructure:"uri"`
	Type        string `yaml:"type,omitempty" mapstructure:"type"`
	Arch        string `yaml:"arch,omitempty" mapstructure:"arch"`
	ReferenceID string `yaml:"reference,omitempty" mapstructure:"reference"`
}

Repository represents the basic configuration for a package repository

type ResetSpec

type ResetSpec struct {
	FormatPersistent bool `yaml:"reset-persistent,omitempty" mapstructure:"reset-persistent"`
	FormatOEM        bool `yaml:"reset-oem,omitempty" mapstructure:"reset-oem"`

	CloudInit        []string     `yaml:"cloud-init,omitempty" mapstructure:"cloud-init"`
	GrubDefEntry     string       `yaml:"grub-entry-name,omitempty" mapstructure:"grub-entry-name"`
	System           *ImageSource `yaml:"system,omitempty" mapstructure:"system"`
	Partitions       ElementalPartitions
	Target           string
	Efi              bool
	State            *InstallState
	DisableBootEntry bool `yaml:"disable-boot-entry,omitempty" mapstructure:"disable-boot-entry"`
}

ResetSpec struct represents all the reset action details

func (ResetSpec) GetGrubLabels

func (r ResetSpec) GetGrubLabels() map[string]string

func (*ResetSpec) Sanitize

func (r *ResetSpec) Sanitize() error

Sanitize checks the consistency of the struct, returns error if unsolvable inconsistencies are found

type RunConfig

type RunConfig struct {
	Reboot      bool              `yaml:"reboot,omitempty" mapstructure:"reboot"`
	PowerOff    bool              `yaml:"poweroff,omitempty" mapstructure:"poweroff"`
	EjectCD     bool              `yaml:"eject-cd,omitempty" mapstructure:"eject-cd"`
	Snapshotter SnapshotterConfig `yaml:"snapshotter,omitempty" mapstructure:"snapshotter"`

	// 'inline' and 'squash' labels ensure config fields
	// are embedded from a yaml and map PoV
	Config `yaml:",inline" mapstructure:",squash"`
}

func (*RunConfig) Sanitize

func (r *RunConfig) Sanitize() error

Sanitize checks the consistency of the struct, returns error if unsolvable inconsistencies are found

type Runner

type Runner interface {
	InitCmd(string, ...string) *exec.Cmd
	Run(string, ...string) ([]byte, error)
	RunCmd(cmd *exec.Cmd) ([]byte, error)
	CommandExists(command string) bool
	GetLogger() Logger
	SetLogger(logger Logger)
}

type Snapshot

type Snapshot struct {
	ID         int
	MountPoint string
	Path       string
	WorkDir    string
	Label      string
	InProgress bool
}

type Snapshotter

type Snapshotter interface {
	InitSnapshotter(state *Partition, efiDir string) error
	StartTransaction() (*Snapshot, error)
	CloseTransaction(snap *Snapshot) error
	CloseTransactionOnError(snap *Snapshot) error
	DeleteSnapshot(id int) error
	GetSnapshots() ([]int, error)
	SnapshotToImageSource(snap *Snapshot) (*ImageSource, error)
}

type SnapshotterConfig

type SnapshotterConfig struct {
	Type     string      `yaml:"type,omitempty" mapstructure:"type"`
	MaxSnaps int         `yaml:"max-snaps,omitempty" mapstructure:"max-snaps"`
	Config   interface{} `yaml:"config,omitempty" mapstructure:"config"`
}

func NewBtrfs

func NewBtrfs() SnapshotterConfig

func NewLoopDevice

func NewLoopDevice() SnapshotterConfig

func (*SnapshotterConfig) CustomUnmarshal

func (c *SnapshotterConfig) CustomUnmarshal(data interface{}) (bool, error)

func (*SnapshotterConfig) UnmarshalYAML

func (c *SnapshotterConfig) UnmarshalYAML(node *yaml.Node) error

type SourceNotFound

type SourceNotFound struct {
}

SourceNotFound is the error to raise when we can't find a source for install/upgrade

func (*SourceNotFound) Error

func (s *SourceNotFound) Error() string

type SyscallInterface

type SyscallInterface interface {
	Chroot(string) error
	Chdir(string) error
}

type SystemState

type SystemState struct {
	Source *ImageSource `yaml:"source,omitempty"`
	Digest string       `yaml:"digest,omitempty"`
	Active bool         `yaml:"active,omitempty"`
	Label  string       `yaml:"label,omitempty"` // Only meaningful for the recovery image
	FS     string       `yaml:"fs,omitempty"`    // Only meaningful for the recovery image
}

SystemState represents data of a deployed OS image

type UpgradeSpec

type UpgradeSpec struct {
	RecoveryUpgrade   bool         `yaml:"recovery,omitempty" mapstructure:"recovery"`
	System            *ImageSource `yaml:"system,omitempty" mapstructure:"system"`
	RecoverySystem    Image        `yaml:"recovery-system,omitempty" mapstructure:"recovery-system"`
	GrubDefEntry      string       `yaml:"grub-entry-name,omitempty" mapstructure:"grub-entry-name"`
	BootloaderUpgrade bool         `yaml:"bootloader,omitempty" mapstructure:"bootloader"`
	Partitions        ElementalPartitions
	State             *InstallState
}

func (UpgradeSpec) GetGrubLabels

func (u UpgradeSpec) GetGrubLabels() map[string]string

func (*UpgradeSpec) Sanitize

func (u *UpgradeSpec) Sanitize() error

Sanitize checks the consistency of the struct, returns error if unsolvable inconsistencies are found

func (*UpgradeSpec) SanitizeForRecoveryOnly

func (u *UpgradeSpec) SanitizeForRecoveryOnly() error

SanitizeForRecoveryOnly sanitizes UpgradeSpec when upgrading recovery only.

type VolumeMount

type VolumeMount struct {
	Mountpoint string   `yaml:"mountpoint,omitempty" mapstructure:"mountpoint"`
	Device     string   `yaml:"device,omitempty" mapstructure:"device"`
	Options    []string `yaml:"options,omitempty" mapstructure:"options"`
	FSType     string   `yaml:"fs,omitempty" mapstructure:"fs"`
}

Jump to

Keyboard shortcuts

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