Documentation
¶
Overview ¶
Package machines models the inventory of remote machines.
A Machine is the testfleet-internal view of a remote host: the union of what Tailscale tells us (name, OS, tags, last-seen) and what local inventory overrides supply (remote_prefix, snapshot_caps). The JSON shape is part of the --json public contract — bump output.SchemaVersion if you change it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyBusy ¶
ApplyBusy overrides idle→busy in place when isBusy(name) reports true.
Only StatusIdle machines are promoted: an offline machine (one we can't reach) can't be meaningfully "busy", and unknown/already-busy states are left as-is. The predicate is supplied by the caller (typically a runs-store ActiveByMachine lookup) so this package needs no dependency on runs — keeping the busy projection free of an import cycle.
func DefaultInventoryPath ¶
DefaultInventoryPath returns ~/.testfleet/inventory.yaml.
Types ¶
type HostOverride ¶
type HostOverride struct {
RemotePrefix string `yaml:"remote_prefix"`
SnapshotCaps string `yaml:"snapshot_caps"`
}
HostOverride mirrors tailscale.HostOverride but lives here so cmd/ packages can load inventory without importing tailscale.
type Inventory ¶
type Inventory struct {
Hosts map[string]HostOverride `yaml:"hosts"`
}
Inventory is the parsed ~/.testfleet/inventory.yaml structure.
Schema (intentionally tiny for MVP):
hosts:
win-5060ti:
remote_prefix: "C:\\testfleet"
snapshot_caps: "vss"
func LoadInventory ¶
LoadInventory reads and parses path. A missing file is not an error — it returns an empty Inventory so callers can call this unconditionally.
type Machine ¶
type Machine struct {
Name string `json:"name"`
Host string `json:"host,omitempty"` // FQDN / IP used for SSH dial; empty = fall back to Name
OS string `json:"os"`
Tags []string `json:"tags"`
Status Status `json:"status"`
SnapshotCaps string `json:"snapshot_caps"`
RemotePrefix string `json:"remote_prefix"`
LastSeen time.Time `json:"last_seen"`
}
Machine is the unified view of a remote host.
JSON tags use snake_case to match the rest of the testfleet wire format. LastSeen serializes as RFC3339; the zero value marshals as "0001-01-01T00:00:00Z".