project

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MPL-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

type Project struct {
	Runtime *runtime.Runtime

	Provisioner *provisioner.Provisioner
	Composer    *composer.Composer
	Workstation *workstation.Workstation
	// contains filtered or unexported fields
}

Project holds the runtime, composer, provisioner and workstation of one context.

func NewProject

func NewProject(contextName string, opts ...*Project) *Project

NewProject creates a Project for contextName and creates the runtime, composer and provisioner. It uses the current context, or "local", when contextName is empty. A non-empty contextName also sets the context of the config handler. It creates the Workstation only for a dev context. EnsureWorkstation creates it for other contexts after Configure. The fields of an optional Project in opts replace the default objects. Tests use this to inject mocks. It panics when the runtime has no config handler.

func (*Project) Bootstrap added in v0.9.0

Bootstrap is the first run of Up. It calls confirm with a blueprint summary before it starts the workstation. When the operator declines, no privileged work or terraform work runs. The provisioner applies with a local backend and then migrates the state to the configured backend. It returns the blueprint, an applied flag, a halt flag and an error. applied is false when confirm declines.

func (*Project) ComposeBlueprint added in v0.9.0

func (p *Project) ComposeBlueprint(blueprintURL ...string) error

ComposeBlueprint generates the context ID and loads the blueprint from blueprintURL or the default sources. It does not write files or generate infrastructure. Use it when only the composed blueprint is necessary.

func (*Project) Configure

func (p *Project) Configure(flagOverrides map[string]any) error

Configure resolves the configuration of the project with flagOverrides and loads the environment variables. It returns an error when resolution or the environment load fails.

func (*Project) EnsureWorkstation added in v0.9.0

func (p *Project) EnsureWorkstation()

EnsureWorkstation creates the Workstation when it is nil and workstation.runtime is set. Call it before code that uses p.Workstation.

func (*Project) Initialize

func (p *Project) Initialize(overwrite bool, blueprintURL ...string) error

Initialize prepares the workstation, loads the blueprint, saves the config and generates the infrastructure files. Then it prepares the tools and loads the environment. overwrite lets the generate step replace existing files. blueprintURL is an optional OCI URL or local .tar.gz path. It returns an error when a step fails.

func (*Project) PerformCleanup

func (p *Project) PerformCleanup() error

PerformCleanup removes the artifacts of the context. It cleans the config state and removes the .kube and .talos directories under contexts/<context>. It removes the contents of .windsor/contexts/<context>, but keeps workstation.yaml. It returns an error if a step fails. When .windsor/contexts/<context> is a file, the error has a remediation hint.

func (*Project) PlanRun added in v0.10.0

func (p *Project) PlanRun(command, to string, continuing bool) (*provisioner.RunPlan, error)

PlanRun builds the run plan for --to and --continue and gives it to the provisioner for the next Up. It returns nil when both are unset. It runs before any work starts, so a bad --to value or a missing record fails before the workstation starts or the config changes.

func (*Project) SetToolRequirements added in v0.9.0

func (p *Project) SetToolRequirements(reqs tools.Requirements)

SetToolRequirements sets the tool families that Initialize checks. When it is not called, Initialize checks all tool families. A command that does not use a tool calls it, so the operator does not have to install that tool.

func (*Project) Up added in v0.9.0

Up generates the blueprint, starts the workstation when it exists and runs the provisioner. Before the provisioner runs, it restores the host route to a cluster that holds the Terraform state. It returns the blueprint, a halt flag and an error. The halt flag is true when an apply hook stops the run cleanly, or when the host route needs a privileged step. The caller then shows the deferred work and exits without an error.

Jump to

Keyboard shortcuts

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