bootstrap

package
v0.15.0-rc.1 Latest Latest
Warning

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

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

Documentation

Overview

Package bootstrap reapplies the stages of an owned initial installation.

Every stage runs on every attempt. Each decides what to do by looking at the host rather than at a record of what a previous attempt claimed to have done, so a host that changed in between converges instead of being skipped.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

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

func New

func New(log *slog.Logger, store *installstate.Store, stages Stages, reporter Reporter) *Coordinator

func (*Coordinator) Run

func (c *Coordinator) Run(ctx context.Context, id Identity) (Outcome, error)

type Identity

type Identity struct{ MachineName, ConfigFingerprint string }

type Outcome

type Outcome struct{ AlreadyComplete bool }

type Reporter

type Reporter interface {
	StageStarted(context.Context, Stage)
	StageFailed(context.Context, Stage, error)
}

type Stage

type Stage string

Stage names the work being reported on. It is a label for status reporting and logs, deliberately not persisted: writing down which stage was reached is what lets a record disagree with the host.

const (
	StagePrepareHost   Stage = "preparing-host"
	StagePrepareRootFS Stage = "preparing-rootfs"
	StageStartNode     Stage = "starting-node"
	StageInstallDaemon Stage = "installing-daemon"
)

type Stages

type Stages interface {
	EnsureHostClean(context.Context) error
	ResolveInputs(context.Context) error
	PrepareHost(context.Context) error
	PrepareRootFS(context.Context) error
	EnsureNodeStarted(context.Context) error
	EnsureDaemonInstalled(context.Context) error
	RepairDaemon(context.Context) error
	VerifyInstalled(context.Context) error
}

Jump to

Keyboard shortcuts

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