Documentation ¶
Index ¶
- Constants
- Variables
- func ChrootHook(config *types.Config, hook string, strict bool, chrootDir string, ...) (err error)
- func Hook(config *types.Config, hook string, strict bool, cloudInitPaths ...string) error
- func InitialFstabData(runner types.Runner, sysroot string) (string, error)
- func MountBindPath(cfg *types.RunConfig, sysroot, overlayDir, path string) error
- func MountEphemeral(cfg *types.RunConfig, sysroot string, overlay types.EphemeralMounts) error
- func MountOverlayPath(cfg *types.RunConfig, sysroot, overlayDir, path string) error
- func MountPersistent(cfg *types.RunConfig, spec *types.MountSpec) error
- func MountVolumes(cfg *types.RunConfig, spec *types.MountSpec) error
- func PowerAction(cfg *types.RunConfig) error
- func Raw2Azure(source string, fs types.FS, logger types.Logger, keepOldImage bool) error
- func Raw2Gce(source string, fs types.FS, logger types.Logger, keepOldImage bool) error
- func RunInit(cfg *types.RunConfig, spec *types.InitSpec) error
- func RunMount(cfg *types.RunConfig, spec *types.MountSpec) error
- func SelinuxRelabel(cfg *types.RunConfig, spec *types.MountSpec) error
- func WithInstallBootloader(bootloader types.Bootloader) func(i *InstallAction) error
- func WithResetBootloader(bootloader types.Bootloader) func(r *ResetAction) error
- func WithUpdateInstallState(updateInstallState bool) func(u *UpgradeRecoveryAction) error
- func WithUpgradeBootloader(bootloader types.Bootloader) func(u *UpgradeAction) error
- func WriteFstab(cfg *types.RunConfig, spec *types.MountSpec, data string) error
- type BuildDiskAction
- func (b *BuildDiskAction) BuildDiskRun() (err error)
- func (b *BuildDiskAction) CreateDiskImage(rawDiskFile string, partImgs ...*types.Image) error
- func (b *BuildDiskAction) CreateDiskPartitionTable(disk string) error
- func (b *BuildDiskAction) CreatePartitionImages() ([]*types.Image, error)
- func (b *BuildDiskAction) CreateRAWDisk(rawImg string) error
- func (b *BuildDiskAction) SetExpandableCloudInitStage() error
- type BuildDiskActionOption
- type BuildISOAction
- type BuildISOActionOption
- type InstallAction
- type InstallActionOption
- type MountFunc
- type ResetAction
- type ResetActionOption
- type UpgradeAction
- type UpgradeActionOption
- type UpgradeRecoveryAction
- func (u UpgradeRecoveryAction) Debugf(s string, args ...interface{})
- func (u UpgradeRecoveryAction) Errorf(s string, args ...interface{})
- func (u UpgradeRecoveryAction) Infof(s string, args ...interface{})
- func (u *UpgradeRecoveryAction) Run() (err error)
- func (u UpgradeRecoveryAction) Warnf(s string, args ...interface{})
- type UpgradeRecoveryActionOption
Constants ¶
const ( MB = int64(1024 * 1024) GB = 1024 * MB )
Variables ¶
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 ¶
Hook is RunStage wrapper that only adds logic to ignore errors in case types.RunConfig.Strict is set to false
func MountBindPath ¶
func MountEphemeral ¶
func MountOverlayPath ¶
func PowerAction ¶
PowerAction executes a power-action (Reboot/PowerOff) after completed install or upgrade and returns any encountered error.
func Raw2Azure ¶
Raw2Azure transforms an image from RAW format into Azure format THIS REMOVES THE SOURCE IMAGE BY DEFAULT
func Raw2Gce ¶
Raw2Gce transforms an image from RAW format into GCE format THIS REMOVES THE SOURCE IMAGE BY DEFAULT
func SelinuxRelabel ¶ added in v2.2.0
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
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) PrepareEFI ¶
func (b *BuildISOAction) PrepareEFI(rootDir, uefiDir string) error
func (*BuildISOAction) PrepareISO ¶
func (b *BuildISOAction) PrepareISO(rootDir, imageDir string) error
func (*BuildISOAction) Run ¶ added in v2.1.0
func (b *BuildISOAction) Run() error
Run will install the system from a given configuration
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 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) Debugf ¶ added in v2.1.0
func (u UpgradeRecoveryAction) Debugf(s string, args ...interface{})
func (UpgradeRecoveryAction) Errorf ¶ added in v2.1.0
func (u UpgradeRecoveryAction) Errorf(s string, args ...interface{})
func (UpgradeRecoveryAction) Infof ¶ added in v2.1.0
func (u UpgradeRecoveryAction) Infof(s string, args ...interface{})
func (*UpgradeRecoveryAction) Run ¶
func (u *UpgradeRecoveryAction) Run() (err error)
func (UpgradeRecoveryAction) Warnf ¶ added in v2.1.0
func (u UpgradeRecoveryAction) Warnf(s string, args ...interface{})
type UpgradeRecoveryActionOption ¶
type UpgradeRecoveryActionOption func(r *UpgradeRecoveryAction) error