apply

package
v0.0.0-...-443b9db Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package apply implements the cross-manager orchestrator that aggregates Plan / Apply / Verify / Rollback across all 13 managers in dependency order.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffReport

type DiffReport struct {
	ByManager map[string][]managers.Change
	Empty     bool
}

DiffReport is a human-renderable drift diff.

type Orchestrator

type Orchestrator struct {
	Env             *config.Env
	Linux           *config.Linux
	Session         session.Session
	Managers        []managers.Manager
	DryRun          bool
	ContinueOnError bool
	// ReformatFilesystems is forwarded to DiskManager during bindSession so
	// `linuxctl --reformat-filesystems apply apply` opts in to destructive
	// mkfs on mismatched filesystems (linuxctl#52). Default false.
	ReformatFilesystems bool
	// contains filtered or unexported fields
}

Orchestrator runs the full plan/apply/verify/rollback pipeline across managers.

func New

func New(env *config.Env, sess session.Session, dryRun bool) *Orchestrator

New constructs an orchestrator. mgrs is optional — when nil the global managers.Registry() snapshot is used and ordered by defaultOrder.

func (*Orchestrator) Apply

Apply runs Plan then executes changes in dependency order. On error, it stops unless ContinueOnError is set, and records applied changes for subsequent Rollback.

func (*Orchestrator) Diff

func (o *Orchestrator) Diff(ctx context.Context) (*DiffReport, error)

Diff is a read-only drift report.

func (*Orchestrator) Plan

func (o *Orchestrator) Plan(ctx context.Context) (PlanResult, error)

Plan runs Plan on every manager and aggregates the resulting changes.

func (*Orchestrator) Rollback

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

Rollback reverses previously applied changes in reverse manager order.

func (*Orchestrator) Verify

func (o *Orchestrator) Verify(ctx context.Context) (*VerifyAggregate, error)

Verify runs Verify on every manager and reports which have drift.

func (*Orchestrator) WithLinux

func (o *Orchestrator) WithLinux(l *config.Linux) *Orchestrator

WithLinux sets the decoded linux.yaml used for per-manager desired-state extraction.

func (*Orchestrator) WithManagers

func (o *Orchestrator) WithManagers(mgrs []managers.Manager) *Orchestrator

WithManagers overrides the default registry lookup. Order matters.

type PlanResult

type PlanResult struct {
	Changes     []managers.Change
	ByManager   map[string][]managers.Change
	TotalCreate int
	TotalUpdate int
	TotalDelete int
}

PlanResult aggregates per-manager changes.

type VerifyAggregate

type VerifyAggregate struct {
	InDrift []string
	Matches bool
	Detail  map[string]managers.VerifyResult
}

VerifyAggregate reports drift across managers.

Jump to

Keyboard shortcuts

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