provision

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpDebugState

func DumpDebugState(failedStep string)

DumpDebugState logs system state useful for diagnosing failures. BOOTy runs as PID 1 in an initramfs — this dump is the only diagnostic data available before reboot, so it must be comprehensive. Step-specific debug commands are run first, followed by comprehensive dump.

func SetPCIVendorCheckFunc

func SetPCIVendorCheckFunc(fn func(string) (bool, error)) func()

SetPCIVendorCheckFunc overrides the PCI vendor detection for testing. Returns a restore function that resets to the original implementation.

Types

type Configurator

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

Configurator handles post-image OS configuration.

func NewConfigurator

func NewConfigurator(diskMgr *disk.Manager) *Configurator

NewConfigurator creates a Configurator.

func (*Configurator) ConfigureDNS

func (c *Configurator) ConfigureDNS(cfg *config.MachineConfig) error

ConfigureDNS writes resolv.conf to the chroot.

func (*Configurator) ConfigureGRUB

func (c *Configurator) ConfigureGRUB(ctx context.Context, cfg *config.MachineConfig) error

ConfigureGRUB writes GRUB kernel parameters and runs update-grub via chroot.

func (*Configurator) ConfigureKubelet

func (c *Configurator) ConfigureKubelet(cfg *config.MachineConfig) error

ConfigureKubelet writes kubelet drop-in configs for provider-id and node labels.

func (*Configurator) CopyMachineFiles

func (c *Configurator) CopyMachineFiles() error

CopyMachineFiles copies files from /deploy/machine-files/ to the root.

func (*Configurator) CopyProvisionerFiles

func (c *Configurator) CopyProvisionerFiles() error

CopyProvisionerFiles copies files from /deploy/file-system/ to the root.

func (*Configurator) CreateEFIBootEntry

func (c *Configurator) CreateEFIBootEntry(ctx context.Context, diskDev, bootPart string) error

CreateEFIBootEntry creates a new EFI boot entry for the installed OS.

func (*Configurator) RemoveEFIBootEntries

func (c *Configurator) RemoveEFIBootEntries(ctx context.Context) error

RemoveEFIBootEntries removes old EFI boot entries matching "ubuntu".

func (*Configurator) RunMachineCommands

func (c *Configurator) RunMachineCommands(ctx context.Context) error

RunMachineCommands executes commands from /deploy/machine-commands/ in chroot.

func (*Configurator) RunPostProvisionCmds

func (c *Configurator) RunPostProvisionCmds(ctx context.Context, cmds []string) error

RunPostProvisionCmds executes custom commands in the chroot after provisioning. Each command is run via /bin/bash -c in the chroot environment.

func (*Configurator) SetHostname

func (c *Configurator) SetHostname(cfg *config.MachineConfig) error

SetHostname writes the hostname to /etc/hostname.

func (*Configurator) SetRootDir

func (c *Configurator) SetRootDir(dir string)

SetRootDir overrides the root directory (for testing).

func (*Configurator) SetupMellanox

func (c *Configurator) SetupMellanox(ctx context.Context, numVFs int) (bool, error)

SetupMellanox detects and configures Mellanox ConnectX NICs. Returns true if firmware values were changed (requiring a hard reboot for reinit).

type HealthReporter

type HealthReporter interface {
	ReportHealthChecks(context.Context, []health.CheckResult) error
}

HealthReporter is an optional provider capability for reporting health check results.

type Orchestrator

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

Orchestrator runs the full provisioning pipeline.

func NewOrchestrator

func NewOrchestrator(cfg *config.MachineConfig, provider config.Provider, diskMgr *disk.Manager) *Orchestrator

NewOrchestrator creates an Orchestrator with the given dependencies.

func (*Orchestrator) Deprovision

func (o *Orchestrator) Deprovision(ctx context.Context) error

Deprovision runs the deprovisioning pipeline. Mode "soft" renames grub.cfg to make the system unbootable. Mode "hard" (default) wipes all disks and removes EFI boot entries.

func (*Orchestrator) FirmwareChanged

func (o *Orchestrator) FirmwareChanged() bool

FirmwareChanged reports whether any provisioning step changed firmware values that require a hard reboot (not kexec) to reinitialize.

func (*Orchestrator) Provision

func (o *Orchestrator) Provision(ctx context.Context) error

Provision runs all provisioning steps sequentially.

type Step

type Step struct {
	Name string
	Fn   func(ctx context.Context) error
}

Step represents a named provisioning step.

Jump to

Keyboard shortcuts

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