Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigureNamedGuestHostname(vm build.VirtualMachineConfig) error
- func CreateTargetExists(config alchemy_build.VirtualMachineConfig) (bool, error)
- func DestroyTargetExists(config alchemy_build.VirtualMachineConfig) (bool, error)
- func DiscoverInstances(bases []build.VirtualMachineConfig) ([]build.VirtualMachineConfig, error)
- func EnsureTartGuestNetwork(projectDir string, vmName string) error
- func EnsureTartGuestNetworkWithOptions(projectDir string, vmName string, options TartGuestNetworkOptions) error
- func InspectInstanceID(config alchemy_build.VirtualMachineConfig) (id string, exists bool, err error)
- func InstanceStorageDirectory(vm build.VirtualMachineConfig) string
- func LinuxLibvirtDomainName(config alchemy_build.VirtualMachineConfig) string
- func LinuxLibvirtURI() string
- func RecordInstance(vm build.VirtualMachineConfig) error
- func RemoveInstanceRecord(vm build.VirtualMachineConfig) error
- func RunDestroy(config alchemy_build.VirtualMachineConfig) error
- func RunHypervVagrantDeployOnWindows(config alchemy_build.VirtualMachineConfig) error
- func RunHypervVagrantDestroyOnWindows(config alchemy_build.VirtualMachineConfig) error
- func RunHypervVagrantStartOnWindows(config alchemy_build.VirtualMachineConfig) error
- func RunHypervVagrantStopOnWindows(config alchemy_build.VirtualMachineConfig) error
- func RunLinuxQemuDeployOnLinux(config alchemy_build.VirtualMachineConfig) error
- func RunLinuxQemuDestroyOnLinux(config alchemy_build.VirtualMachineConfig) error
- func RunLinuxQemuStartOnLinux(config alchemy_build.VirtualMachineConfig) error
- func RunLinuxQemuStopOnLinux(config alchemy_build.VirtualMachineConfig) error
- func RunStart(config alchemy_build.VirtualMachineConfig) error
- func RunStop(config alchemy_build.VirtualMachineConfig) error
- func RunTartDeployOnMacOS(config alchemy_build.VirtualMachineConfig) error
- func RunTartDestroyOnMacOS(config alchemy_build.VirtualMachineConfig) error
- func RunTartStartOnMacOS(config alchemy_build.VirtualMachineConfig) error
- func RunTartStopOnMacOS(config alchemy_build.VirtualMachineConfig) error
- func RunUtmDeployOnMacOS(config alchemy_build.VirtualMachineConfig) error
- func RunUtmDeployOnMacOSWithCredentialAcknowledgement(config alchemy_build.VirtualMachineConfig, acknowledged bool) error
- func RunUtmDestroyOnMacOS(config alchemy_build.VirtualMachineConfig) error
- func RunUtmStartOnMacOS(config alchemy_build.VirtualMachineConfig) error
- func RunUtmStopOnMacOS(config alchemy_build.VirtualMachineConfig) error
- func SupportsCreate(config alchemy_build.VirtualMachineConfig) bool
- func SupportsDestroy(config alchemy_build.VirtualMachineConfig) bool
- func SupportsStart(config alchemy_build.VirtualMachineConfig) bool
- func SupportsStop(config alchemy_build.VirtualMachineConfig) bool
- func UtmConfigBridgeInterfaces(data []byte) []string
- func ValidateTartGuestNetworkConfig() error
- func WithUtmQueryBudget(budget time.Duration, fn func() error) error
- type GuestNetworkCheckMode
- type GuestNetworkError
- type GuestNetworkReport
- type GuestNetworkStage
- type GuestNetworkStatus
- type HypervVagrantExecutionSettings
- type InstanceRecord
- type NetworkMode
- type StartTargetState
- type TartGuestNetworkOptions
- type VirtualMachineState
Constants ¶
const TartMacOSBridgedInterfaceEnvVar = tartMacOSBridgedInterfaceEnvVar
TartMacOSBridgedInterfaceEnvVar names the host interface Tart VMs are bridged to; unset means Tart's shared NAT network.
const UtmListingQueryBudget = 90 * time.Second
UtmListingQueryBudget bounds the UTM queries of one listing. Targets inspected after it is spent report an inspection error (an unknown row).
const UtmNetworkModeEnvVar = "SAILWRIGHT_UTM_NETWORK_MODE"
UtmNetworkModeEnvVar selects the network mode for newly created UTM VMs. Unset or "shared" uses Shared (NAT); "bridged" explicitly opts into Bridged (LAN) networking and remains subject to the guest-security guard.
Variables ¶
var TartMacOSNetworkEnvVars = []string{
tartMacOSDNSServersEnvVar,
tartMacOSDNSServersForceEnvVar,
tartMacOSNetworkCheckEnvVar,
tartMacOSNetworkCheckURLsEnvVar,
tartMacOSNetworkCheckDNSNamesEnvVar,
tartMacOSNetworkCheckTimeoutEnvVar,
tartMacOSBridgedInterfaceEnvVar,
}
TartMacOSNetworkEnvVars lists the Tart guest network variables: guest DNS, the readiness check and the bridged interface. Gateway jobs receive them only through env_passthrough, and the gateway does not redact their values (they hold resolver addresses and URLs, not credentials).
Functions ¶
func ConfigureNamedGuestHostname ¶ added in v0.27.0
func ConfigureNamedGuestHostname(vm build.VirtualMachineConfig) error
ConfigureNamedGuestHostname uses the guest agent, so even a cloned guest with an inherited network identity is selected by its provider identity, not its IP. Defaults are deliberately untouched. Tart uses its existing SSH provisioning.
func CreateTargetExists ¶ added in v0.7.0
func CreateTargetExists(config alchemy_build.VirtualMachineConfig) (bool, error)
func DestroyTargetExists ¶ added in v0.7.0
func DestroyTargetExists(config alchemy_build.VirtualMachineConfig) (bool, error)
func DiscoverInstances ¶ added in v0.27.0
func DiscoverInstances(bases []build.VirtualMachineConfig) ([]build.VirtualMachineConfig, error)
DiscoverInstances queries the hypervisor, not the registry. Defaults are supplied by the caller, so old installations need no metadata or migration.
func EnsureTartGuestNetwork ¶ added in v0.29.0
EnsureTartGuestNetwork applies the configured guest DNS servers and checks guest access, system DNS and HTTPS from inside the running Tart VM. It returns a *GuestNetworkError when the guest is reachable by IP but not ready for networked provisioning.
func EnsureTartGuestNetworkWithOptions ¶ added in v0.29.0
func EnsureTartGuestNetworkWithOptions(projectDir string, vmName string, options TartGuestNetworkOptions) error
EnsureTartGuestNetworkWithOptions is EnsureTartGuestNetwork with options.
func InspectInstanceID ¶ added in v0.27.0
func InspectInstanceID(config alchemy_build.VirtualMachineConfig) (id string, exists bool, err error)
InspectInstanceID returns the hypervisor's identifier of the VM for config, which changes when the VM is destroyed and created again under the same name. It works for stopped VMs. exists is false when no VM exists. UTM uses its bundle UUID; Tart uses the local VM directory identity because clones can share hardware IDs.
func InstanceStorageDirectory ¶ added in v0.27.0
func InstanceStorageDirectory(vm build.VirtualMachineConfig) string
InstanceStorageDirectory selects the filesystem used for the new clone.
func LinuxLibvirtDomainName ¶ added in v0.14.0
func LinuxLibvirtDomainName(config alchemy_build.VirtualMachineConfig) string
LinuxLibvirtDomainName returns the managed libvirt domain name for a VM config.
func LinuxLibvirtURI ¶ added in v0.14.0
func LinuxLibvirtURI() string
LinuxLibvirtURI returns the configured libvirt connection URI.
func RecordInstance ¶ added in v0.27.0
func RecordInstance(vm build.VirtualMachineConfig) error
RecordInstance stores metadata only after successful creation. Unknown image provenance is represented by an empty image_version, never an invented version.
func RemoveInstanceRecord ¶ added in v0.27.0
func RemoveInstanceRecord(vm build.VirtualMachineConfig) error
func RunDestroy ¶ added in v0.7.0
func RunDestroy(config alchemy_build.VirtualMachineConfig) error
func RunHypervVagrantDeployOnWindows ¶ added in v0.2.0
func RunHypervVagrantDeployOnWindows(config alchemy_build.VirtualMachineConfig) error
func RunHypervVagrantDestroyOnWindows ¶ added in v0.7.0
func RunHypervVagrantDestroyOnWindows(config alchemy_build.VirtualMachineConfig) error
func RunHypervVagrantStartOnWindows ¶ added in v0.7.0
func RunHypervVagrantStartOnWindows(config alchemy_build.VirtualMachineConfig) error
func RunHypervVagrantStopOnWindows ¶ added in v0.7.0
func RunHypervVagrantStopOnWindows(config alchemy_build.VirtualMachineConfig) error
func RunLinuxQemuDeployOnLinux ¶ added in v0.14.0
func RunLinuxQemuDeployOnLinux(config alchemy_build.VirtualMachineConfig) error
func RunLinuxQemuDestroyOnLinux ¶ added in v0.14.0
func RunLinuxQemuDestroyOnLinux(config alchemy_build.VirtualMachineConfig) error
func RunLinuxQemuStartOnLinux ¶ added in v0.14.0
func RunLinuxQemuStartOnLinux(config alchemy_build.VirtualMachineConfig) error
func RunLinuxQemuStopOnLinux ¶ added in v0.14.0
func RunLinuxQemuStopOnLinux(config alchemy_build.VirtualMachineConfig) error
func RunStart ¶ added in v0.7.0
func RunStart(config alchemy_build.VirtualMachineConfig) error
func RunStop ¶ added in v0.7.0
func RunStop(config alchemy_build.VirtualMachineConfig) error
func RunTartDeployOnMacOS ¶ added in v0.6.0
func RunTartDeployOnMacOS(config alchemy_build.VirtualMachineConfig) error
func RunTartDestroyOnMacOS ¶ added in v0.7.0
func RunTartDestroyOnMacOS(config alchemy_build.VirtualMachineConfig) error
func RunTartStartOnMacOS ¶ added in v0.7.0
func RunTartStartOnMacOS(config alchemy_build.VirtualMachineConfig) error
func RunTartStopOnMacOS ¶ added in v0.7.0
func RunTartStopOnMacOS(config alchemy_build.VirtualMachineConfig) error
func RunUtmDeployOnMacOS ¶
func RunUtmDeployOnMacOS(config alchemy_build.VirtualMachineConfig) error
func RunUtmDeployOnMacOSWithCredentialAcknowledgement ¶ added in v0.30.0
func RunUtmDeployOnMacOSWithCredentialAcknowledgement(config alchemy_build.VirtualMachineConfig, acknowledged bool) error
RunUtmDeployOnMacOSWithCredentialAcknowledgement passes the caller's explicit acceptance of the image credentials to the offline bundle creator.
func RunUtmDestroyOnMacOS ¶ added in v0.7.0
func RunUtmDestroyOnMacOS(config alchemy_build.VirtualMachineConfig) error
func RunUtmStartOnMacOS ¶ added in v0.7.0
func RunUtmStartOnMacOS(config alchemy_build.VirtualMachineConfig) error
func RunUtmStopOnMacOS ¶ added in v0.7.0
func RunUtmStopOnMacOS(config alchemy_build.VirtualMachineConfig) error
func SupportsCreate ¶ added in v0.14.0
func SupportsCreate(config alchemy_build.VirtualMachineConfig) bool
func SupportsDestroy ¶ added in v0.7.0
func SupportsDestroy(config alchemy_build.VirtualMachineConfig) bool
func SupportsStart ¶ added in v0.7.0
func SupportsStart(config alchemy_build.VirtualMachineConfig) bool
func SupportsStop ¶ added in v0.7.0
func SupportsStop(config alchemy_build.VirtualMachineConfig) bool
func UtmConfigBridgeInterfaces ¶ added in v0.30.0
UtmConfigBridgeInterfaces returns the host interfaces selected by Bridged adapters. An empty interface name represents UTM's automatic selection.
func ValidateTartGuestNetworkConfig ¶ added in v0.29.0
func ValidateTartGuestNetworkConfig() error
ValidateTartGuestNetworkConfig reports invalid Tart guest network settings before any VM work starts.
Types ¶
type GuestNetworkCheckMode ¶ added in v0.29.0
type GuestNetworkCheckMode string
GuestNetworkCheckMode selects how much of the guest network is verified after a VM start.
const ( // GuestNetworkCheckFull verifies guest access, system DNS and HTTPS. GuestNetworkCheckFull GuestNetworkCheckMode = "full" // GuestNetworkCheckOffline verifies guest access only and reports that // internet access was not verified. GuestNetworkCheckOffline GuestNetworkCheckMode = "offline" // GuestNetworkCheckOff disables the readiness check. GuestNetworkCheckOff GuestNetworkCheckMode = "off" )
type GuestNetworkError ¶ added in v0.29.0
type GuestNetworkError struct {
Report GuestNetworkReport
}
GuestNetworkError is returned when a guest fails its readiness check.
func (*GuestNetworkError) Error ¶ added in v0.29.0
func (e *GuestNetworkError) Error() string
type GuestNetworkReport ¶ added in v0.29.0
type GuestNetworkReport struct {
Guest string
Status GuestNetworkStatus
// Stage is the failed stage; empty unless Status is failed.
Stage GuestNetworkStage
// Detail is the last probe error of the failed stage.
Detail string
// Hint is a concrete next step for the failed stage.
Hint string
// Resolvers lists the guest's system resolvers with a direct probe
// result, collected when system DNS fails.
Resolvers []string
// DNSConfig summarizes what the DNS configuration step did.
DNSConfig string
// Verified lists the probes that passed.
Verified []string
Attempts int
Elapsed time.Duration
}
GuestNetworkReport describes a readiness check result without secrets.
func (GuestNetworkReport) String ¶ added in v0.29.0
func (r GuestNetworkReport) String() string
String renders a single-line summary suitable for CLI and gateway logs.
type GuestNetworkStage ¶ added in v0.29.0
type GuestNetworkStage string
GuestNetworkStage names one step of the readiness check.
const ( GuestNetworkStageAccess GuestNetworkStage = "guest-access" GuestNetworkStageDNSConfig GuestNetworkStage = "dns-config" GuestNetworkStageSystemDNS GuestNetworkStage = "system-dns" GuestNetworkStageHTTPS GuestNetworkStage = "https" )
type GuestNetworkStatus ¶ added in v0.29.0
type GuestNetworkStatus string
GuestNetworkStatus is the overall result of a readiness check.
const ( GuestNetworkReady GuestNetworkStatus = "ready" GuestNetworkOffline GuestNetworkStatus = "offline" GuestNetworkSkipped GuestNetworkStatus = "skipped" GuestNetworkFailed GuestNetworkStatus = "failed" )
type HypervVagrantExecutionSettings ¶ added in v0.7.0
func ResolveHypervVagrantExecutionSettings ¶ added in v0.7.0
func ResolveHypervVagrantExecutionSettings(config alchemy_build.VirtualMachineConfig) (HypervVagrantExecutionSettings, error)
type InstanceRecord ¶ added in v0.27.0
type InstanceRecord struct {
SchemaVersion int `json:"schema_version"`
Name string `json:"name"`
OS string `json:"os"`
Type string `json:"type"`
Arch string `json:"arch"`
Engine build.VirtualizationEngine `json:"engine"`
HypervisorName string `json:"hypervisor_name"`
InstanceID string `json:"instance_id"`
CreatedAt time.Time `json:"created_at"`
ImageVersion string `json:"image_version"`
}
InstanceRecord is supplemental metadata. Hypervisor state remains authoritative. SchemaVersion leaves room for additional lifecycle policy fields.
type NetworkMode ¶ added in v0.27.0
NetworkMode describes exposure, rather than promising a particular firewall configuration. Host-only networks are classified as nat because they do not expose the guest to the LAN.
func InspectNetworkMode ¶ added in v0.27.0
func InspectNetworkMode(vm alchemy_build.VirtualMachineConfig, creating bool) NetworkMode
InspectNetworkMode inspects the current VM, or the intended deployment when creating is true. Failed or incomplete inspection always returns unknown.
func UtmConfigNetworkMode ¶ added in v0.30.0
func UtmConfigNetworkMode(data []byte) NetworkMode
UtmConfigNetworkMode classifies the adapters of an XML UTM config.plist. Invalid or incomplete configuration returns unknown.
type StartTargetState ¶ added in v0.7.0
type StartTargetState = VirtualMachineState
type TartGuestNetworkOptions ¶ added in v0.29.0
type TartGuestNetworkOptions struct {
// ReadOnly checks the network but does not change guest DNS; planned
// changes are only reported. Used for `provision --check`.
ReadOnly bool
}
TartGuestNetworkOptions adjusts EnsureTartGuestNetworkWithOptions.
type VirtualMachineState ¶ added in v0.7.0
func InspectStartTarget ¶ added in v0.7.0
func InspectStartTarget(config alchemy_build.VirtualMachineConfig) (VirtualMachineState, error)
func InspectStopTarget ¶ added in v0.7.0
func InspectStopTarget(config alchemy_build.VirtualMachineConfig) (VirtualMachineState, error)
Source Files
¶
- command-runner.go
- create.go
- destroy.go
- guest_identity.go
- guest_network_readiness.go
- hyperv_named.go
- instance_id.go
- instances.go
- linux-libvirt-deploy.go
- macos-silicon-deploy.go
- network.go
- network_util.go
- shell_util.go
- start.go
- stop.go
- tart-macos-deploy.go
- tart_guest_network.go
- utm_registration.go
- windows-hyperv-deploy.go