action

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func ChrootHook

func ChrootHook(config *v1.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 *v1.Config, hook string, strict bool, cloudInitPaths ...string) error

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

func MountBindPath added in v1.2.0

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

func MountEphemeral added in v1.2.0

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

func MountOverlayPath added in v1.2.0

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

func MountPersistent added in v1.2.0

func MountPersistent(cfg *v1.RunConfig, sysroot string, persistent v1.PersistentMounts) error

func PowerAction

func PowerAction(cfg *v1.RunConfig) error

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

func Raw2Azure added in v1.1.0

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

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

func Raw2Gce added in v1.1.0

func Raw2Gce(source string, fs v1.FS, logger v1.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 *v1.RunConfig, spec *v1.InitSpec) error

func RunMount added in v1.2.0

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

func WithInstallBootloader added in v1.2.0

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

func WithResetBootloader added in v1.2.0

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

func WithUpgradeBootloader added in v1.2.0

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

func WriteFstab added in v1.2.0

func WriteFstab(cfg *v1.RunConfig, spec *v1.MountSpec) error

Types

type BuildDiskAction added in v1.1.0

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

func NewBuildDiskAction added in v1.1.0

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

func (*BuildDiskAction) BuildDiskRun added in v1.1.0

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

func (*BuildDiskAction) CreateDiskImage added in v1.1.0

func (b *BuildDiskAction) CreateDiskImage(rawDiskFile string, partImgs ...*v1.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 added in v1.1.0

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

func (*BuildDiskAction) CreatePartitionImages added in v1.1.0

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

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

func (*BuildDiskAction) CreateRAWDisk added in v1.1.0

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

CreateRAWDisk creates the RAW disk image file including all required partitions

func (*BuildDiskAction) SetExpandableCloudInitStage added in v1.1.0

func (b *BuildDiskAction) SetExpandableCloudInitStage() error

type BuildDiskActionOption added in v1.2.0

type BuildDiskActionOption func(b *BuildDiskAction) error

func WithDiskBootloader added in v1.2.0

func WithDiskBootloader(bootloader v1.Bootloader) BuildDiskActionOption

type BuildISOAction

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

func NewBuildISOAction

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

func (*BuildISOAction) ISORun

func (b *BuildISOAction) ISORun() error

BuildISORun will install the system from a given configuration

func (*BuildISOAction) PrepareEFI added in v1.2.0

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

func (*BuildISOAction) PrepareISO added in v1.2.0

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

type BuildISOActionOption

type BuildISOActionOption func(a *BuildISOAction)

func WithLiveBootloader added in v1.2.0

func WithLiveBootloader(b v1.Bootloader) BuildISOActionOption

type InstallAction

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

func NewInstallAction

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

func (InstallAction) Run

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

InstallRun will install the system from a given configuration

type InstallActionOption added in v1.2.0

type InstallActionOption func(i *InstallAction) error

type MountFunc added in v1.2.0

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

type ResetAction

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

func NewResetAction

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

func (ResetAction) Run

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

ResetRun will reset the cos system to by following several steps

type ResetActionOption added in v1.2.0

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 *v1.RunConfig, spec *v1.UpgradeSpec, opts ...UpgradeActionOption) *UpgradeAction

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 added in v1.2.0

type UpgradeActionOption func(r *UpgradeAction) error

Jump to

Keyboard shortcuts

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