action

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: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MB = int64(1024 * 1024)
	GB = 1024 * MB
)

Variables

View Source
var ErrUpgradeRecoveryFromRecovery = errors.New("Can not upgrade recovery from recovery partition")

Functions

func ChrootHook

func ChrootHook(config *types.Config, hook string, strict bool, chrootDir string, bindMounts map[string]string, cloudInitPaths ...string) (err error)

ChrootHook executes Hook inside a chroot environment

func Hook

func Hook(config *types.Config, hook string, strict bool, cloudInitPaths ...string) error

Hook is RunStage wrapper that only adds logic to ignore errors in case types.RunConfig.Strict is set to false

func InitialFstabData

func InitialFstabData(runner types.Runner, sysroot string) (string, error)

func MountBindPath

func MountBindPath(cfg *types.RunConfig, sysroot, overlayDir, path string) error

func MountEphemeral

func MountEphemeral(cfg *types.RunConfig, sysroot string, overlay types.EphemeralMounts) error

func MountOverlayPath

func MountOverlayPath(cfg *types.RunConfig, sysroot, overlayDir, path string) error

func MountPersistent

func MountPersistent(cfg *types.RunConfig, spec *types.MountSpec) error

func MountVolumes

func MountVolumes(cfg *types.RunConfig, spec *types.MountSpec) error

func PowerAction

func PowerAction(cfg *types.RunConfig) error

PowerAction executes a power-action (Reboot/PowerOff) after completed install or upgrade and returns any encountered error.

func Raw2Azure

func Raw2Azure(source string, fs types.FS, logger types.Logger, keepOldImage bool) error

Raw2Azure transforms an image from RAW format into Azure format THIS REMOVES THE SOURCE IMAGE BY DEFAULT

func Raw2Gce

func Raw2Gce(source string, fs types.FS, logger types.Logger, keepOldImage bool) error

Raw2Gce transforms an image from RAW format into GCE format THIS REMOVES THE SOURCE IMAGE BY DEFAULT

func RunInit

func RunInit(cfg *types.RunConfig, spec *types.InitSpec) error

func RunMount

func RunMount(cfg *types.RunConfig, spec *types.MountSpec) error

func WithInstallBootloader

func WithInstallBootloader(bootloader types.Bootloader) func(i *InstallAction) error

func WithResetBootloader

func WithResetBootloader(bootloader types.Bootloader) func(r *ResetAction) error

func WithUpdateInstallState

func WithUpdateInstallState(updateInstallState bool) func(u *UpgradeRecoveryAction) error

func WithUpgradeBootloader

func WithUpgradeBootloader(bootloader types.Bootloader) func(u *UpgradeAction) error

func WriteFstab

func WriteFstab(cfg *types.RunConfig, spec *types.MountSpec, data string) error

Types

type BuildDiskAction

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

func NewBuildDiskAction

func NewBuildDiskAction(cfg *types.BuildConfig, spec *types.DiskSpec, opts ...BuildDiskActionOption) (*BuildDiskAction, error)

func (*BuildDiskAction) BuildDiskRun

func (b *BuildDiskAction) BuildDiskRun() (err error)

func (*BuildDiskAction) CreateDiskImage

func (b *BuildDiskAction) CreateDiskImage(rawDiskFile string, partImgs ...*types.Image) error

CreateDiskImage creates the final image by truncating the image with the proper size and concatenating the contents of the given partitions. No partition table is written

func (*BuildDiskAction) CreateDiskPartitionTable

func (b *BuildDiskAction) CreateDiskPartitionTable(disk string) error

func (*BuildDiskAction) CreatePartitionImages

func (b *BuildDiskAction) CreatePartitionImages() ([]*types.Image, error)

CreatePartitionImage creates partition image files and returns a slice of the created images

func (*BuildDiskAction) CreateRAWDisk

func (b *BuildDiskAction) CreateRAWDisk(rawImg string) error

CreateRAWDisk creates the RAW disk image file including all required partitions

func (*BuildDiskAction) SetExpandableCloudInitStage

func (b *BuildDiskAction) SetExpandableCloudInitStage() error

type BuildDiskActionOption

type BuildDiskActionOption func(b *BuildDiskAction) error

func WithDiskBootloader

func WithDiskBootloader(bootloader types.Bootloader) BuildDiskActionOption

type BuildISOAction

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

func NewBuildISOAction

func NewBuildISOAction(cfg *types.BuildConfig, spec *types.LiveISO, opts ...BuildISOActionOption) *BuildISOAction

func (*BuildISOAction) ISORun

func (b *BuildISOAction) ISORun() error

BuildISORun will install the system from a given configuration

func (*BuildISOAction) PrepareEFI

func (b *BuildISOAction) PrepareEFI(rootDir, uefiDir string) error

func (*BuildISOAction) PrepareISO

func (b *BuildISOAction) PrepareISO(rootDir, imageDir string) error

type BuildISOActionOption

type BuildISOActionOption func(a *BuildISOAction)

func WithLiveBootloader

func WithLiveBootloader(b types.Bootloader) BuildISOActionOption

type InstallAction

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

func NewInstallAction

func NewInstallAction(cfg *types.RunConfig, spec *types.InstallSpec, opts ...InstallActionOption) (*InstallAction, error)

func (InstallAction) Run

func (i InstallAction) Run() (err error)

InstallRun will install the system from a given configuration

type InstallActionOption

type InstallActionOption func(i *InstallAction) error

type MountFunc

type MountFunc func(cfg *types.RunConfig, sysroot, overlayDir, path string) error

type ResetAction

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

func NewResetAction

func NewResetAction(cfg *types.RunConfig, spec *types.ResetSpec, opts ...ResetActionOption) (*ResetAction, error)

func (ResetAction) Run

func (r ResetAction) Run() (err error)

ResetRun will reset the cos system to by following several steps

type ResetActionOption

type ResetActionOption func(r *ResetAction) error

type UpgradeAction

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

UpgradeAction represents the struct that will run the upgrade from start to finish

func NewUpgradeAction

func NewUpgradeAction(config *types.RunConfig, spec *types.UpgradeSpec, opts ...UpgradeActionOption) (*UpgradeAction, error)

func (UpgradeAction) Debug

func (u UpgradeAction) Debug(s string, args ...interface{})

func (UpgradeAction) Error

func (u UpgradeAction) Error(s string, args ...interface{})

func (UpgradeAction) Info

func (u UpgradeAction) Info(s string, args ...interface{})

func (*UpgradeAction) Run

func (u *UpgradeAction) Run() (err error)

type UpgradeActionOption

type UpgradeActionOption func(r *UpgradeAction) error

type UpgradeRecoveryAction

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

UpgradeRecoveryAction represents the struct that will run the recovery upgrade from start to finish

func NewUpgradeRecoveryAction

func NewUpgradeRecoveryAction(config *types.RunConfig, spec *types.UpgradeSpec, opts ...UpgradeRecoveryActionOption) (*UpgradeRecoveryAction, error)

func (UpgradeRecoveryAction) Debug

func (u UpgradeRecoveryAction) Debug(s string, args ...interface{})

func (UpgradeRecoveryAction) Error

func (u UpgradeRecoveryAction) Error(s string, args ...interface{})

func (UpgradeRecoveryAction) Info

func (u UpgradeRecoveryAction) Info(s string, args ...interface{})

func (*UpgradeRecoveryAction) Run

func (u *UpgradeRecoveryAction) Run() (err error)

type UpgradeRecoveryActionOption

type UpgradeRecoveryActionOption func(r *UpgradeRecoveryAction) error

Jump to

Keyboard shortcuts

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