fleet

package
v0.2026248.128 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TaskAutoExports = map[string]bool{
	"USER":       true,
	"UID":        true,
	"GID":        true,
	"HOME":       true,
	"ARCH":       true,
	"BUILD_ARCH": true,
}

TaskAutoExports are the auto-exported variable names reserved for the generator; `vars:` entries may not shadow these, and every `${VAR}` reference resolves against (auto-exports ∪ candy.Vars).

Functions

func BedCheckLiveRefs

func BedCheckLiveRefs(name string, children map[string]*spec.FleetNode) []string

BedCheckLiveRefs returns the ordered `charly check live` targets for a bed: the substrate itself first, then each nested child as a sorted dotted path. A `target: android` child shares the parent pod's venue (Descent.Venue == "parent") and has no own image — its app-presence checks are baked into the parent ref, so it is skipped. Pure + unit-tested.

func CandyArtifactRegisters

func CandyArtifactRegisters(layers []spec.CandyReader) map[string]bool

CandyArtifactRegisters returns the DISTINCT `register:` hints declared across every candy's artifact list — name-blind (it reads each artifact's own declaration, never a candy name).

func CandyMapKey

func CandyMapKey(layer spec.CandyReader) string

CandyMapKey returns the candy's map key: the full @github ref for a remote candy (RepoPath/SubPathPrefix+Name), else the bare Name. A ROOT-LEVEL remote candy (the candy de-submodule cutover — a standalone candy repo whose manifest lives at the repo root, SubPathPrefix "") keys as the repo path itself: appending the name would double it (github.com/org/layer-ripgrep/layer-ripgrep).

func CandyStageDirName

func CandyStageDirName(layer spec.CandyReader) string

CandyStageDirName returns the content-addressed staging dir name for a remote candy's copied tree (name.version).

func ClassifyNodeTarget

func ClassifyNodeTarget(node *spec.FleetNode, path string) string

ClassifyNodeTarget picks the target discriminator for a node. Uses node.Target when non-empty (canonical pod|vm|kubernetes|local|android, set from the node-form kind by the loader's fleetTargetForDisc). For ref-based deploys with no charly.yml entry, the deploy name itself is the hint: a literal `host`/`local` LEAF → local target; anything else → pod. A pure function of node+path with no LoadUnified/executor dependency.

func DeployNestedLocalChildren

func DeployNestedLocalChildren(parent string, children map[string]*spec.FleetNode, apply func(childKey, dotted string) error) error

DeployNestedLocalChildren deploys a parent venue's nested target:local children via the dotted-path dispatch — each host-rooted (local/SSH-shell) child applies its candies in place. Promoted from sdk/deploykit (#55 U4), now that HostRooted is a spec predicate; deploykit keeps a re-export forwarder so its charly callers compile unchanged.

plugin-deploy-vm's PostApply brings up nested target:pod children as in-guest quadlets, but it SKIPS target:local children — they carry no image, they apply candies in place. Without this loop a nested local child never deploys, and a deploy-scope check against it either fails or (worse) silently checks nothing.

Both sites that own a VM venue call it: the isVM bed ROOT and bringUpMembers' VM-member branch. They differ only in how a child deploy is executed (the root wraps it in a recorded step(); a member shells out directly), so that is the injected apply func.

func DescriptionInfo

func DescriptionInfo(d string) string

DescriptionInfo returns the first non-empty line of a candy/box description, trimmed.

func ExternalInPlaceVenue

func ExternalInPlaceVenue(node *spec.FleetNode) bool

ExternalInPlaceVenue reports whether node's stamped venue is an EXTERNAL deploy substrate that applies its workload IN PLACE — local-like: no container image to build, no `charly config`/`charly start`, teardown via `charly fleet del` (replay the recorded reverse ops). local/android/kubernetes/exampledeploy are in-place (parent/none venues); pod is the one externalized substrate that is NOT in-place (excluded by requiring venue != container implicitly, since parent/none never equals container). Mirrors HostRooted's shape (#55 W3 B2-full) — the plugin-reachable equivalent of the former core-private bedExternalInPlace(target string), which queried isExternalDeploySubstrate against the live provider registry: every node this predicate sees comes from an already-loaded, Descent-stamped project, so the registry round-trip was redundant with data already on the wire (the SAME finding candy/plugin-fleet's externalInPlaceFromDescent already proved for a bed's sibling MEMBERS — this promotes that one shared predicate for the bed ROOT too, R3).

func FindVMClaimant

func FindVMClaimant(tree map[string]spec.FleetNode, vmEntity string) (string, spec.FleetNode, bool)

FindVMClaimant returns the first node claiming the given VM entity via requires_exclusive.

func HolderAddrFor

func HolderAddrFor(name string, node spec.FleetNode) spec.HolderAddr

HolderAddrFor derives the resource-arbiter holder address for a deploy-tree node — servable off a plain map[string]spec.FleetNode (the shape both a freshly-loaded uf.Fleet and a resolved-project envelope's Deploy map carry).

func HostRooted

func HostRooted(node *spec.FleetNode) bool

HostRooted reports whether node's stamped descent trait is host-rooted — the substrate's own ROOT executor runs directly on the host (a local/SSH-shell venue, not a container/VM venue). Reads the wire-stamped node.Descent directly (every node a LoadUnified'd project produces is Descent-stamped by StampDescent), so it needs no registry access. Promoted from sdk/deploykit's former private host-rooted predicate (#55 U4) so DeployNestedLocalChildren + the bed-session apply path (PersistBedDeployOverrides) share ONE predicate over the spec value type; deploykit callers repoint to spec/fleet.HostRooted directly.

func IsContainerVenue

func IsContainerVenue(node *spec.FleetNode) bool

IsContainerVenue reports whether node's stamped venue is the container-exec (pod) substrate. Mirrors HostRooted's shape (#55 W3 A4) — see IsVmVenue.

func IsVmVenue

func IsVmVenue(node *spec.FleetNode) bool

IsVmVenue reports whether node's stamped venue is the SSH-hop (vm) substrate. Mirrors HostRooted's shape (#55 W3 A4) — promoted so a plugin-side deploy-orchestration consumer (sdk/deploykit's BringUpMembers/TearDownMembers) and any future caller share ONE predicate over the wire-stamped node.Descent, instead of each re-deriving the venue check independently.

func MergeFleetNode

func MergeFleetNode(dst, src spec.FleetNode) spec.FleetNode

MergeFleetNode overlays src onto dst: every authored (yaml-tagged, non-zero) field of src wins, and the loader-DERIVED structural TREE fields (Target/Children/Members) merge explicitly (src non-zero wins) because the reflect loop skips yaml:"-" fields. Pure (reflect over the spec.FleetNode value type).

func PathLeaf

func PathLeaf(path string) string

PathLeaf returns the last segment of a dotted deployment path. "foo.bar.baz" -> "baz"; "foo" -> "foo"; "" -> "". Unlike SplitDottedPath, a malformed path (leading/trailing/doubled dots) still yields its raw trailing segment rather than nil — callers that only care about the LEAF (e.g. a "host"/"local" literal-name check) want the tolerant form.

func ResolveNodePath

func ResolveNodePath(roots map[string]spec.FleetNode, path string) (*spec.FleetNode, []*spec.FleetNode, error)

ResolveNodePath resolves a dotted deployment path against a root map, returning the leaf node, its ancestor chain, and any lookup error.

func SortedNestedKeys

func SortedNestedKeys(children map[string]*spec.FleetNode) []string

SortedNestedKeys returns the keys of a children map in deterministic order so traversal produces stable output across runs.

func SplitDottedPath

func SplitDottedPath(path string) []string

SplitDottedPath splits a dotted deployment path into segments. An empty input or a path with any empty segment (leading/trailing/doubled dots) yields nil so callers can flag the error at their layer with the original offending path string.

func TaskKnownNames

func TaskKnownNames(vars map[string]string) map[string]bool

TaskKnownNames returns the ${NAME} references that resolve cleanly for this candy: auto-exports ∪ candy.Vars keys.

Types

This section is empty.

Jump to

Keyboard shortcuts

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