Documentation
¶
Overview ¶
Package kit is the importable contract a HOST-COUPLED plugin candy implements to run against charly's live check engine — the seam that lets a check verb whose logic needs the running deployment (exec-in-container, host TCP dial, host-vantage HTTP) live in its own candy module instead of charly's module.
A host-coupled verb candy implements CheckVerbProvider; charly runs it in EITHER placement, invisibly above the registry: IN-PROCESS (compiled-in — charly passes the live *Runner as a CheckContext) OR OUT-OF-PROCESS (the CheckContext legs are served back to the candy over the host's reverse channel — ExecutorService for Exec + CheckContextService for HTTPDo/AddBackground, F2 — and the scalar legs ride the env_json snapshot). RunVerb is identical in both. This package imports only the stdlib + charly/spec (the generated param/Op types), so a candy module can import it without pulling charly's package main.
Index ¶
- Constants
- Variables
- func AcquireFileLock(path string, blocking bool) (release func() error, err error)
- func AcquireLocalPkgBuildLock(srcDir string) (func() error, error)
- func AddCandyDeployment(paths *LedgerPaths, candyName, deployID string, update func(*CandyRecord)) error
- func AddCandyDeploymentVia(exec spec.DeployExecutor, paths *LedgerPaths, candyName, deployID string, ...) error
- func ApplyPortOverrides(ports []string, overrides []string) ([]string, error)
- func BuildArchExports() string
- func BuildBuilderRunArgs(opts BuilderRunOpts) []string
- func BuilderCollectContext(word string, in spec.BuilderCollectInput) map[string]any
- func BuilderResolve(word string, in spec.BuilderResolveInput) (spec.BuilderResolveReply, error)
- func BuilderReverse(word string, in spec.BuilderReverseInput) []spec.ReverseOp
- func BuilderRun(ctx context.Context, opts BuilderRunOpts) ([]byte, error)
- func ContainerName(boxName string) string
- func ContainerNameInstance(boxName, instance string) string
- func ContainerPortsFromMappings(mappings []string) []int
- func DecodeInput(in map[string]any, out any)
- func DefaultDeployConfigPath() (string, error)
- func DeleteCandyRecord(paths *LedgerPaths, layer string) error
- func DeleteDeployRecord(paths *LedgerPaths, id string) error
- func DetectEngine() (string, error)
- func DetectRunMode(runEngine string) string
- func DirExists(path string) bool
- func DotenvLoaded(name string) bool
- func EffectiveTags(stepTags []string) []string
- func EngineBinary(engine string) string
- func EnrichNoProxy(envs []string, containerNames []string) []string
- func EnsureCharlyInGuest(ctx context.Context, ssh SSHArgs, charlyBin, hostVer, strategyRaw string) (string, error)
- func EnsureCharlyInVenue(ctx context.Context, ve DeployExecutor, charlyBin, hostVer string) (string, error)
- func EnsureSshConfigInclude(home string) error
- func EnvMapToPairs(env map[string]string) []string
- func EnvPairsToMap(pairs []string) map[string]string
- func EnvdDir(home string) string
- func EnvdFilePath(home, candyName string) string
- func ExpandHostHome(path string) string
- func ExpandPath(path string, home string) string
- func FileExists(path string) bool
- func FillReverseUninstallCmds(ops []ReverseOp, renderUninstall func(format string, packages []string) string)
- func FindMappingValue(m *yaml.Node, key string) *yaml.Node
- func FindPortOwner(port int, engine string) (owner string, ownerType string)
- func FirstNonEmpty(vals ...string) string
- func FirstYAMLVersionLine(data []byte) string
- func FormatPortConflicts(conflicts []PortConflict, image string) string
- func FormatPortMapping(p ParsedPortMapping) string
- func GPURunArgs(engine string) []string
- func HostCharlyIsNewer(hostVer, venueVerOut string) bool
- func InputStr(c *spec.Op, key string) string
- func IsAutoPort(mapping string) bool
- func IsGitSubmoduleDir(p, root string) bool
- func ListVmSshAliases(home string) ([]string, error)
- func LoadProcessDotenv(dir string) error
- func LoadWorkspaceEnv(workspace string) ([]string, error)
- func ManagedBlockBody(shell ShellKind, home string) string
- func ManagedBody(text string) string
- func MapValue(m *yaml.Node, key string) *yaml.Node
- func MappingChild(m *yaml.Node, key string) *yaml.Node
- func MappingRoot(n *yaml.Node) *yaml.Node
- func MarkersForTag(marker string) (begin, end string)
- func MigrateCandidateYAMLFiles(dir string, treeSubdirs []string) []string
- func NestedContainerName(path string) string
- func NodeShapedValue(val *yaml.Node) bool
- func NormalizeTag(t string) string
- func OpUnifyCandidateFiles(dir string) []string
- func ParseContainerPort(mapping string) (int, error)
- func ParseEnvBytes(data []byte) ([]string, error)
- func ParseEnvFile(path string) ([]string, error)
- func ParseHostPort(mapping string) (int, error)
- func ParseTaskMode(mode string, def uint32) uint32
- func PosArtifact(c *spec.Op) []string
- func PosCommandFields(c *spec.Op) []string
- func PosKeyNameSplit(c *spec.Op) []string
- func PosLibvirtQmp(c *spec.Op) []string
- func PosTarget(c *spec.Op) []string
- func PosText(c *spec.Op) []string
- func RemoveImagesByReference(engineBin, reference string)
- func RemoveManagedBlockAt(path, marker string) error
- func RemoveSshConfigInclude(home string) error
- func RemoveVmSshStanza(home string, alias string) (remaining int, err error)
- func RenderDownloadScript(op *spec.Op, candyVars map[string]string) string
- func RenderEnvdBody(candyName string, envVars map[string]string, pathAdd []string) string
- func RenderManagedBlockStrip(path, marker string) string
- func RenderOpCommand(op *spec.Op, ctxPath string, candyVars map[string]string) (string, bool)
- func ReplaceOrAppendManagedBlock(existing, body, marker string) string
- func ReplaceOrPrependManagedBlock(existing, body, marker string) string
- func ResolveAutoEnable(envVal string, cfgVal *bool) bool
- func ResolveDeployPorts(containerPorts []int, pins, prior []string, occupied map[int]bool) ([]string, error)
- func ResolveEncryptedStoragePath(envVal, cfgVal string) string
- func ResolveEnvVars(globalEnv []string, deployEnv []string, deployEnvFile string, envDir string, ...) ([]string, error)
- func ResolvePackageName(pkg string, packageMap map[string]string, distros []string) string
- func ResolveValue(envVal, cfgVal, defaultVal string) string
- func ResolveVolumesPath(envVal, cfgVal string) string
- func RunCaptureCmd(cmd *exec.Cmd) (string, string, int, error)
- func RunReverseOps(ops []ReverseOp, exec ReverseExecutor)
- func SameStringSlice(a, b []string) bool
- func SaveRuntimeConfig(cfg *RuntimeConfig) error
- func ScalarNode(v string) *yaml.Node
- func SetByDotPath(path, dotpath, valueYAML string) error
- func ShDoubleQuote(v string) string
- func ShDoubleQuotePath(v string) string
- func ShQuoteArg(v string) string
- func ShQuoteEnv(v string) string
- func ShellInitFilePath(shell ShellKind, home string) string
- func ShellQuote(s string) string
- func SortStrings(s []string)
- func SshConfigPath(home string) string
- func SshFragmentPath(home string) string
- func StampDescent(node *spec.Deploy)
- func StripManagedBlock(existing, marker string) string
- func StripPortSuffix(s string) (string, string)
- func SystemdUserAvailable() bool
- func TaskShellPreamble(candyVars, opEnv map[string]string) string
- func TransferImage(srcEngine, dstEngine, imageRef string) error
- func TransferToRootful(imageRef string) error
- func TrimPreview(s string) string
- func UserScopeBindMounts(hostHome string) (map[string]string, error)
- func UserScopeEnv(hostHome string) map[string]string
- func ValidateBindAddress(value string) error
- func ValidateEngine(value, field string) error
- func ValidateRunMode(value string) error
- func VmSshAlias(vmName string) string
- func WaitForCloudInit(ctx context.Context, ssh SSHArgs, poll PollFunc) error
- func WaitForPackageLock(ctx context.Context, ssh SSHArgs, poll PollFunc) error
- func WaitForSSH(ctx context.Context, ssh SSHArgs, poll PollFunc) error
- func WalkPlans(ctx context.Context, exec DeployExecutor, plans []spec.InstallPlanView, ...) ([]spec.ReverseOp, error)
- func WrapContainerCommand(script string) string
- func WriteCandyRecord(paths *LedgerPaths, rec *CandyRecord) error
- func WriteDeployRecord(paths *LedgerPaths, rec *DeployRecord) error
- func WriteDeployRecordVia(exec spec.DeployExecutor, paths *LedgerPaths, rec *DeployRecord) error
- func WriteVmSshStanza(home string, s VmSshStanza) error
- type BuilderRunOpts
- type CalVer
- type CandyRecord
- type CharlyInstallStrategy
- type CheckContext
- type CheckVerbProvider
- type DeployExecutor
- type DeployRecord
- type EmitOpts
- type EngineConfig
- type EnvConfig
- type Executor
- type FetchedImage
- type GraphicsEndpoint
- type HTTPRequest
- type HTTPResponse
- type JumpKind
- type LedgerLock
- type LedgerPaths
- type MethodSpec
- type NestedExecutor
- func (n *NestedExecutor) GetFile(ctx context.Context, remotePath string, asRoot bool, opts EmitOpts) ([]byte, error)
- func (n *NestedExecutor) Kind() string
- func (n *NestedExecutor) PutFile(ctx context.Context, localPath, remotePath string, mode uint32, ownerRoot bool, ...) error
- func (n *NestedExecutor) ResolveHome(ctx context.Context, user string) (string, error)
- func (n *NestedExecutor) RunBuilder(ctx context.Context, opts BuilderRunOpts) ([]byte, error)
- func (n *NestedExecutor) RunCapture(ctx context.Context, script string) (string, string, int, error)
- func (n *NestedExecutor) RunSystem(ctx context.Context, script string, opts EmitOpts) error
- func (n *NestedExecutor) RunUser(ctx context.Context, script string, opts EmitOpts) error
- func (n *NestedExecutor) Venue() string
- type NestedJump
- type ParsedPortMapping
- type PollCond
- type PollCondition
- type PollFunc
- type PortConflict
- type ProvisionActor
- type ResolvedReadiness
- type ResolvedRuntime
- type Result
- type ReverseExecutor
- type ReverseOp
- type ReverseOpKind
- type ReverseRunner
- type RunMode
- type RuntimeConfig
- type RuntimeVmConfig
- type SSHArgs
- type SSHExecutor
- func (e *SSHExecutor) GetFile(ctx context.Context, remotePath string, asRoot bool, opts EmitOpts) ([]byte, error)
- func (e *SSHExecutor) Kind() string
- func (e *SSHExecutor) PutFile(ctx context.Context, localPath, remotePath string, mode uint32, ownerRoot bool, ...) error
- func (e *SSHExecutor) ResolveHome(ctx context.Context, user string) (string, error)
- func (e *SSHExecutor) RunBuilder(ctx context.Context, opts BuilderRunOpts) ([]byte, error)
- func (e *SSHExecutor) RunCapture(ctx context.Context, script string) (string, string, int, error)
- func (e *SSHExecutor) RunSystem(ctx context.Context, script string, opts EmitOpts) error
- func (e *SSHExecutor) RunUser(ctx context.Context, script string, opts EmitOpts) error
- func (e *SSHExecutor) SSHBaseArgs() []string
- func (e *SSHExecutor) Venue() string
- func (e *SSHExecutor) WaitForCloudInit(ctx context.Context) error
- func (e *SSHExecutor) WaitForPackageLock(ctx context.Context) error
- func (e *SSHExecutor) WaitForSSH(ctx context.Context) error
- type Scope
- type ServicePackagedDesc
- type ShellExecutor
- func (ShellExecutor) GetFile(ctx context.Context, remotePath string, asRoot bool, opts EmitOpts) ([]byte, error)
- func (ShellExecutor) Kind() string
- func (ShellExecutor) PutFile(_ context.Context, localPath, remotePath string, mode uint32, ownerRoot bool, ...) error
- func (ShellExecutor) ResolveHome(ctx context.Context, user string) (string, error)
- func (ShellExecutor) RunBuilder(ctx context.Context, opts BuilderRunOpts) ([]byte, error)
- func (ShellExecutor) RunCapture(ctx context.Context, script string) (string, string, int, error)
- func (s ShellExecutor) RunSystem(ctx context.Context, script string, opts EmitOpts) error
- func (s ShellExecutor) RunUser(ctx context.Context, script string, opts EmitOpts) error
- func (ShellExecutor) Venue() string
- type ShellKind
- type Status
- type StepDescriptor
- type StepKind
- type StepKindName
- type StepProvider
- type StepRecord
- type SystemPackagesDesc
- type TagExpr
- type Venue
- type VmSource
- type VmSshStanza
- type WalkOpts
Constants ¶
const ( ScopeSystem = spec.ScopeSystem ScopeUser = spec.ScopeUser ScopeUserProfile = spec.ScopeUserProfile ReverseOpPackageRemove = spec.ReverseOpPackageRemove ReverseOpCargoUninstall = spec.ReverseOpCargoUninstall ReverseOpNpmUninstallG = spec.ReverseOpNpmUninstallG ReverseOpPixiEnvRemove = spec.ReverseOpPixiEnvRemove ReverseOpRmFileSystem = spec.ReverseOpRmFileSystem ReverseOpRmFileUser = spec.ReverseOpRmFileUser ReverseOpRmDirRecursive = spec.ReverseOpRmDirRecursive ReverseOpServiceDisable = spec.ReverseOpServiceDisable ReverseOpServiceRemove = spec.ReverseOpServiceRemove ReverseOpRemoveDropin = spec.ReverseOpRemoveDropin ReverseOpRestoreEnabled = spec.ReverseOpRestoreEnabled ReverseOpRemoveManaged = spec.ReverseOpRemoveManaged ReverseOpRemoveEnvdFile = spec.ReverseOpRemoveEnvdFile ReverseOpRemoveRepoFile = spec.ReverseOpRemoveRepoFile ReverseOpCoprDisable = spec.ReverseOpCoprDisable ReverseOpPluginScript = spec.ReverseOpPluginScript )
const ( UnifiedFileName = "charly.yml" // the ONE box/candy manifest filename DefaultBoxDir = "box" // discovered box/<name>/ directory DefaultCandyDir = "candy" // discovered candy/<name>/ directory )
Project path constants shared by core and kit. Core aliases each via `const X = kit.X`.
const ( KwRun spec.StepKeyword = "run" KwCheck spec.StepKeyword = "check" KwAgentRun spec.StepKeyword = "agent-run" KwAgentCheck spec.StepKeyword = "agent-check" KwInclude spec.StepKeyword = "include" )
const DeployConfigEnv = "CHARLY_DEPLOY_CONFIG"
DeployConfigEnv overrides the per-host deploy-config PATH. A check bed sets it so a disposable run never touches the operator's real ~/.config/charly/charly.yml.
const LedgerSchemaVersion = "2026.161.1649"
LedgerSchemaVersion is the install-ledger record format version, DECOUPLED from the project schema HEAD so a non-ledger cutover never invalidates a migrated ledger. Read by core's ledger path (ReadDeployRecord/ReadCandyRecord, which hard-reject a record lacking this stamp). Core aliases via `const … = kit.LedgerSchemaVersion`.
const SignalKillErrMarker = "terminated by signal"
RunCaptureCmd is the shared output-capture helper. Identical behaviour to the pre-cutover testrun.go's runCapture (which lived on the now- deleted Executor interface): exit codes are NOT errors, only spawn failures are. Lives here so SSHExecutor / NestedExecutor implementations can share it without circular imports. SignalKillErrMarker is the stable substring every RunCaptureCmd caller stamps into a signal-kill error (see below). The check runner's probeWasKilled matches it to tell a probe that was KILLED before completing (infra interruption → re-attempt) from a probe that RAN and returned a failure (authoritative → never retried). One shared literal (R3).
const VenueLocal = "local"
VenueLocal is the stable Venue() identifier for the local host. Exported so install_ledger.go and tests can reference it without hard-coding the literal.
Variables ¶
var ErrLockBusy = errors.New("file lock held by another process")
ErrLockBusy is returned by a NON-blocking AcquireFileLock when another holder already owns the lock. Callers detect it with errors.Is to render a precise "already in progress" message.
var LocalImageExists = defaultLocalImageExists
LocalImageExists checks whether an image reference exists in the given engine's local store. Package-level var for testability (same pattern as DetectGPU in gpu.go).
var (
PollRemote = vmshared.PollRemote
)
var ReadinessProvider = func() ResolvedReadiness { rr, _ := vmshared.ResolveReadiness(nil) return rr }
ReadinessProvider returns the resolved readiness bounds the executors' waits use. Defaults to the built-in bounds; charly overrides it at init with its project-aware loadedReadiness (charly/readiness_config.go).
var RuntimeConfigPath = defaultRuntimeConfigPath
RuntimeConfigPath returns the path to the user's runtime config file.
var SudoLocalImageExists = defaultSudoLocalImageExists
SudoLocalImageExists checks whether an image reference exists in the rootful (sudo podman) local store. Mirrors LocalImageExists but always queries the root user's storage namespace, regardless of the caller's BuildEngine. The rootless and rootful podman storage roots are isolated, so an image built by the user's `podman build` is invisible to `sudo podman` until transferred.
Package-level var for testability (same pattern as LocalImageExists).
var SystemdUserRuntimeDir = func() string { return filepath.Join("/run/user", strconv.Itoa(os.Geteuid()), "systemd") }
SystemdUserRuntimeDir returns the path the directory check probes — `/run/user/<uid>/systemd`. Exposed as a package-level var so tests can redirect to a t.TempDir().
var ValidateRecord = func(kind, label string, v any) error { return nil }
ValidateRecord is the egress-validation seam for ledger writes. The ledger (install_ledger.go) validates each record against its egress schema before writing; charly injects its ValidateEgressValue here at init (see charly/install_ledger_egress.go). Defaults to a no-op for standalone kit use.
Functions ¶
func AcquireFileLock ¶
AcquireFileLock takes an advisory flock on path (creating the file + parent dirs on demand) and returns a release closure that unlocks + closes.
blocking selects the contention behavior:
- true → LOCK_EX: wait until the lock is free (serialize, never fail).
- false → LOCK_EX|LOCK_NB: return ErrLockBusy immediately when another holder exists.
The lock file is deliberately NOT unlinked on release (unlinking a held lock races a waiter that already opened the prior inode). flock is per-open-file-description, so two acquires of the same path — even within ONE process — contend, which the duplicate-run guard relies on.
func AcquireLocalPkgBuildLock ¶ added in v0.2026190.848
AcquireLocalPkgBuildLock serializes concurrent localpkg builds sharing a source dir.
func AddCandyDeployment ¶ added in v0.2026190.848
func AddCandyDeployment(paths *LedgerPaths, candyName, deployID string, update func(*CandyRecord)) error
AddCandyDeployment adds deployID to candy.DeployedBy and writes the record. Used at install time.
func AddCandyDeploymentVia ¶ added in v0.2026190.848
func AddCandyDeploymentVia(exec spec.DeployExecutor, paths *LedgerPaths, candyName, deployID string, update func(*CandyRecord)) error
AddCandyDeploymentVia is the executor-routed variant of AddCandyDeployment. When exec is nil or a local executor, it falls back to operator-side file I/O (today's behaviour). When exec is a non-local DeployExecutor (SSHExecutor / NestedExecutor), the ledger file I/O goes through exec.GetFile + exec.RunSystem so the ledger lands on the substrate's filesystem under the substrate's ~/.config/opencharly/installed/ — matching the install's actual venue (arch-vm.arch-host writes in the arch VM guest; sway-pod with nested pods writes in the parent pod; etc.).
func ApplyPortOverrides ¶ added in v0.2026190.848
ApplyPortOverrides modifies port mappings based on --port flags. Each override is "newHost:containerPort". It replaces the host port for the matching container port in the ports list. Preserves protocol suffixes like /udp.
func BuildArchExports ¶
func BuildArchExports() string
BuildArchExports emits the BUILD_ARCH=$(uname -m) + ARCH=<buildkit-triplet> shell preamble so a cmd:/download: body can template ${ARCH}/${BUILD_ARCH} at deploy-time the same way the container build gets them from BuildKit's TARGETARCH.
func BuildBuilderRunArgs ¶ added in v0.2026190.848
func BuildBuilderRunArgs(opts BuilderRunOpts) []string
BuildBuilderRunArgs assembles the podman/docker run argv. Extracted for unit-testability — we assert the produced argv rather than actually spawning a container in tests.
func BuilderCollectContext ¶
func BuilderCollectContext(word string, in spec.BuilderCollectInput) map[string]any
BuilderCollectContext returns the builder-specific stage-context keys for `word` given the host-supplied candy descriptor. An unknown word returns nil (a custom candy builder with no plugin keeps base-only context — the host never invokes a plugin for it).
func BuilderResolve ¶
func BuilderResolve(word string, in spec.BuilderResolveInput) (spec.BuilderResolveReply, error)
BuilderResolve renders `word`'s build-time multi-stage from the host-supplied context, returning the pieces the host splices into the Containerfile: Stage (pre-main-FROM), CopyArtifacts + CopyBinary (post-main-FROM), or InlineFragment (in-candy, inline builders). An unknown word is a LOUD error (never a silent empty stage). This is the ONE render both the box-build plugin OpResolve and the in-proc pod-overlay build-emit call (R3).
func BuilderReverse ¶
func BuilderReverse(word string, in spec.BuilderReverseInput) []spec.ReverseOp
BuilderReverse returns the teardown ops for `word` given its resolved stage context (the BuilderCollectContext output the host stored on the BuilderStep). An unknown word, or a context missing the keys a builder needs, returns nil (no teardown — the same best-effort the in-proc builders had).
func BuilderRun ¶ added in v0.2026190.848
func BuilderRun(ctx context.Context, opts BuilderRunOpts) ([]byte, error)
BuilderRun runs the configured builder container. Returns the command's combined stdout+stderr on success; on failure, returns the output plus the exec error.
func ContainerName ¶ added in v0.2026190.848
ContainerName returns the deterministic container name for an image or a `<base>/<instance>` deploy key (the `/` is canonicalized to `-`).
func ContainerNameInstance ¶ added in v0.2026190.848
ContainerNameInstance returns the container name with an optional instance suffix.
func ContainerPortsFromMappings ¶ added in v0.2026190.848
ContainerPortsFromMappings extracts the container-side port number from each mapping. "auto" sentinels are skipped (they have no container port to extract — they ARE the request to allocate one). Unparseable entries are silently dropped (the loud-skip warning lives in CheckPortAvailability).
func DecodeInput ¶
DecodeInput decodes an Op's plugin_input (map[string]any) into a candy's CUE-generated typed params struct via a JSON round-trip. A nil/empty input leaves out at its zero value; the host has already validated the input against the served schema.
func DefaultDeployConfigPath ¶ added in v0.2026186.124
DefaultDeployConfigPath returns the per-host deploy overlay file (~/.config/charly/charly.yml), honoring the DeployConfigEnv override.
func DeleteCandyRecord ¶ added in v0.2026190.848
func DeleteCandyRecord(paths *LedgerPaths, layer string) error
DeleteCandyRecord removes candy/<candy>.json.
func DeleteDeployRecord ¶ added in v0.2026190.848
func DeleteDeployRecord(paths *LedgerPaths, id string) error
DeleteDeployRecord removes deploys/<deploy-id>.json; silently ignores not-found (teardown is idempotent).
func DetectEngine ¶ added in v0.2026190.848
DetectEngine auto-detects the container engine: prefers podman, falls back to docker.
func DetectRunMode ¶ added in v0.2026190.848
DetectRunMode returns "quadlet" when podman is present AND a functional systemd-user session is reachable (systemctl binary + XDG_RUNTIME_DIR + /run/user/<uid>/systemd directory). Otherwise returns "direct".
The functional-systemd-user check (added 2026-04-27) catches nested environments — harness sandbox pods, supervisord-only containers, sysvinit hosts — that have the systemctl binary present but no running `systemd --user` session. Without this check, `charly bundle add <name> <ref>` would silently pick run_mode=quadlet, write the .container file, and fail at `systemctl --user daemon-reload` time. With the check, run_mode=direct is auto-selected on those hosts and `runConfigDirect()` (in config_image.go) emits a `podman run -d` invocation instead.
func DotenvLoaded ¶ added in v0.2026190.848
DotenvLoaded reports whether a given env var name was loaded from the project .env file.
func EffectiveTags ¶ added in v0.2026191.1413
EffectiveTags normalizes and de-dups a step's tags, preserving first-seen order. (Per-step tags only — there is no group-level tag inheritance.)
func EngineBinary ¶ added in v0.2026190.848
func EnrichNoProxy ¶ added in v0.2026190.848
EnrichNoProxy appends container hostnames to NO_PROXY when a proxy is configured. Chrome does not support CIDR ranges in NO_PROXY — only exact hostnames and domain suffixes. This ensures container-to-container traffic bypasses the proxy.
func EnsureCharlyInGuest ¶ added in v0.2026186.739
func EnsureCharlyInGuest(ctx context.Context, ssh SSHArgs, charlyBin, hostVer, strategyRaw string) (string, error)
EnsureCharlyInGuest is the vm-deploy PrepareVenue-time coordinator: it layers the cloud-init charly_install.strategy over a HOST-SURFACE delivery (os/exec ssh/scp against the managed alias), because at PrepareVenue time the reverse channel has NOT yet served a guest executor. auto/scp: deliver the host charly when the guest's is absent/older; skip: verify presence only.
func EnsureCharlyInVenue ¶ added in v0.2026186.739
func EnsureCharlyInVenue(ctx context.Context, ve DeployExecutor, charlyBin, hostVer string) (string, error)
EnsureCharlyInVenue is the GENERIC copy-in over the DeployExecutor abstraction (container podman-cp / local cp / the reverse-channel guest executor) — used by the deploy walk + nested-pod delegation. The venue's PATH charly is used when at least as new as the host (NEVER shadowed/downgraded); otherwise charlyBin (the HOST charly, guaranteed current + from-box-capable, fed from HostEnv.CharlyBin) is delivered to /tmp/charly-<hostVer> (outside $PATH, invoked by explicit path).
func EnsureSshConfigInclude ¶ added in v0.2026186.739
EnsureSshConfigInclude inserts the managed `Include ~/.config/charly/ssh_config` directive at the TOP of the user's ~/.ssh/config (creating it if needed) — the Include MUST be outside any Host block (ssh_config(5) lexical scoping), so it is PREPENDED. Idempotent.
func EnvMapToPairs ¶ added in v0.2026190.848
EnvMapToPairs converts the deploy schema's env map into sorted KEY=VALUE pairs (the OCI-label wire + env-resolution chain form).
func EnvPairsToMap ¶ added in v0.2026190.848
EnvPairsToMap converts KEY=VALUE pairs (the CLI -e / label wire form) into the map form the deploy schema stores since the env-shape unification.
func EnvdFilePath ¶
EnvdFilePath returns the env file path for a given candy under a home.
func ExpandHostHome ¶ added in v0.2026190.848
ExpandHostHome expands ~ and $HOME in a path using the actual user's home directory.
func ExpandPath ¶ added in v0.2026190.848
ExpandPath expands ~, ${HOME} and $HOME in a path string to the given home directory. ${HOME} is replaced before bare $HOME so the braced form is handled (a bare $HOME ReplaceAll would not match "${HOME}").
func FileExists ¶
FileExists reports whether path exists and is a regular (non-dir) file.
func FillReverseUninstallCmds ¶ added in v0.2026190.848
func FillReverseUninstallCmds(ops []ReverseOp, renderUninstall func(format string, packages []string) string)
FillReverseUninstallCmds renders the host-venue uninstall command for every ReverseOpPackageRemove op in the slice from the format's uninstall_template (the embedded build vocabulary, charly/charly.yml), in place. Called at install/record time by the local deploy target and the external vm deploy (R3 — one shared filler) when the DistroConfig is in hand, so the persisted ledger op carries the exact removal command the teardown will run. Ops whose format declares no uninstall_template, or whose format isn't in the config, are left with an empty UninstallCmd (teardown then errors loudly rather than silently running a wrong command). The renderUninstall seam maps (format, packages) → the format's uninstall command, or "" when the format has no uninstall template. It keeps this function free of the buildkit DistroConfig/RenderTemplate dependency (which would cycle kit→buildkit→kit once reverse_ops lives in kit) — the charly caller (deploy_target_external.go) closes over DistroCfg + RenderTemplate.
func FindMappingValue ¶
FindMappingValue returns the value node for key in a YAML mapping node, or nil. (Like MapValue, but requires the key node to be a scalar — the form the migration transforms + the core loader's legacy-shape detection both use.)
func FindPortOwner ¶ added in v0.2026190.848
FindPortOwner checks running containers to identify what is using a port.
func FirstNonEmpty ¶
FirstNonEmpty returns the first non-empty string in vals, or "".
func FirstYAMLVersionLine ¶
FirstYAMLVersionLine extracts the value of the first top-level `version:` line.
func FormatPortConflicts ¶ added in v0.2026190.848
func FormatPortConflicts(conflicts []PortConflict, image string) string
FormatPortConflicts produces a user-friendly error message with remediation suggestions.
func FormatPortMapping ¶ added in v0.2026190.848
func FormatPortMapping(p ParsedPortMapping) string
FormatPortMapping is the inverse of ParsePortMapping. Empty bindAddr / proto are omitted; trailing-zero / equal ports collapse to canonical short forms that podman accepts.
func GPURunArgs ¶ added in v0.2026190.848
func HostCharlyIsNewer ¶ added in v0.2026186.739
HostCharlyIsNewer reports whether the host charly (hostVer) is STRICTLY newer than a venue's charly (venueVerOut = raw `charly version` stdout). The single CalVer arbiter (R3): a venue version that is unparseable/absent → host wins (treated as older); both parse → strict CalVer compare (host newer → true, venue equal-or-newer → false, never downgraded); host unparseable → false (never clobber a venue charly on an unprovable claim).
func InputStr ¶ added in v0.2026187.747
InputStr reads a string field from the step's desugared plugin input map — the per-verb fields live there since the schema-compaction cutover (the `<word>: <input>` sugar desugars to Plugin/PluginInput; core #Op carries no per-verb fields).
func IsAutoPort ¶ added in v0.2026190.848
IsAutoPort reports whether a port-list entry is the literal "auto" sentinel. Authors write `port: [auto]` (or `port: [auto, "8443:443"]` to mix auto-allocation with explicit pins) in charly.yml.
func IsGitSubmoduleDir ¶
IsGitSubmoduleDir reports whether p (≠ root) contains a .git entry (a nested submodule/repo boundary).
func ListVmSshAliases ¶ added in v0.2026186.739
ListVmSshAliases returns the alias names in the managed fragment, sorted.
func LoadProcessDotenv ¶ added in v0.2026190.848
LoadProcessDotenv loads .env from dir into the process environment. Variables already set in the environment are NOT overwritten (real env wins). Silently returns nil if .env does not exist.
func LoadWorkspaceEnv ¶ added in v0.2026190.848
LoadWorkspaceEnv loads env vars from a workspace .env file (if it exists). Does NOT run direnv — direnv modifies the host env before charly runs. Returns nil, nil if no .env file found.
func ManagedBlockBody ¶
ManagedBlockBody returns the shell-specific loop that sources the env.d directory under a home. POSIX-sh for bash/zsh, fish syntax for fish.
func ManagedBody ¶ added in v0.2026186.739
ManagedBody returns just the contents between the begin/end fence markers (the global, untagged managed block) in text. Returns "" when the markers are absent.
func MappingChild ¶ added in v0.2026186.1019
MappingChild looks up a key in a mapping node. Returns the value node or nil if missing. yaml mapping nodes store [key, value, key, value, …].
func MappingRoot ¶ added in v0.2026186.124
MappingRoot unwraps a YAML document node to its top-level mapping node (or nil). Shared by charly core (via the mappingRoot alias) and the out-of-module candy/plugin-migrate engine (R3).
func MarkersForTag ¶
MarkersForTag returns the begin/end fence pair for a marker tag. Empty tag → the global-block fence; non-empty → a per-candy fence so multiple candies coexist.
func MigrateCandidateYAMLFiles ¶
MigrateCandidateYAMLFiles is the ONE candidate-file scanner the multi-document doc-migration steps share AND the core loader's legacy-vocab rejection scan uses: every `.yml`/`.yaml` under each of treeSubdirs (walked recursively, skipping nested git submodules + any `testdata` dir) plus the root-level YAML siblings in dir. Sorted, deduplicated.
func NestedContainerName ¶ added in v0.2026190.848
NestedContainerName maps a dotted deploy path (e.g. "stack.web") to the container/venue name form ("stack_web") used for nested-executor addressing.
func NodeShapedValue ¶
NodeShapedValue reports whether a mapping node carries a reserved kind word as a key (i.e. it is a name-first node-form value).
func NormalizeTag ¶ added in v0.2026191.1413
NormalizeTag strips a single leading '@' so `@smoke` and `smoke` are identical — authors commonly write `@smoke` from Gherkin habit, but the sigil is optional in the YAML surface.
func OpUnifyCandidateFiles ¶
OpUnifyCandidateFiles is the candidate-file set the op/plan-unify migrators AND the core loader's legacy-test-vocab rejection scan walk (candy/ + box/ trees + root siblings).
func ParseContainerPort ¶ added in v0.2026190.848
ParseContainerPort extracts the container port from a mapping. Accepts every form ParsePortMapping does, including the IP:H:C bind-address form.
func ParseEnvBytes ¶ added in v0.2026190.848
ParseEnvBytes parses KEY=VALUE entries from raw bytes. Skips comments (#), blank lines, and strips surrounding quotes from values.
func ParseEnvFile ¶ added in v0.2026190.848
ParseEnvFile reads a .env file and returns KEY=VALUE strings. Skips comments (#), blank lines, and supports KEY=VALUE and KEY="VALUE" (strips quotes). Compatible with docker --env-file format.
func ParseHostPort ¶ added in v0.2026190.848
ParseHostPort extracts the host port from a mapping. Accepts every form ParsePortMapping does, including the IP:H:C bind-address form.
func ParseTaskMode ¶
ParseTaskMode parses a candy task mode string ("0644","0o755") into a uint32 file mode, falling back to def when empty/unparseable.
func PosArtifact ¶
func PosCommandFields ¶
PosCommandFields splits the input `command` into argv slots, prefixed with `--` so kong does not treat embedded -flags as its own (libvirt:guest/exec). For shell metachars use `command: "sh -c '<full>'"`.
func PosKeyNameSplit ¶
PosKeyNameSplit splits the input `key` on whitespace (libvirt send-key: "ctrl alt F2" → 3 slots).
func PosLibvirtQmp ¶
PosLibvirtQmp emits a QMP method name + optional JSON args (input text = method, input = JSON).
func RemoveImagesByReference ¶ added in v0.2026186.831
func RemoveImagesByReference(engineBin, reference string)
RemoveImagesByReference best-effort removes every local image whose repository BASENAME exactly equals `reference` (e.g. "<deploy>-overlay") via `<engineBin> images … | rmi`. Silent on error (image cleanup is best-effort). engineBin is the resolved engine binary (the host resolves "podman"/"docker"/"auto" and passes the concrete binary — kit does no detection).
The `--filter reference=<reference>` glob is NOT trusted alone: podman lists EVERY repo:tag of any matched image ID, so a base image or a cross-deploy image that shares content (same image ID as the overlay) leaks into the output. rmi'ing those blindly would destroy the base + unrelated deploys' images. So the emitted repo is re-checked in Go and only the EXACT `<reference>` repo is removed.
func RemoveManagedBlockAt ¶ added in v0.2026190.848
RemoveManagedBlockAt strips the managed block (tagged with marker) from the file at path, in place. A file left empty is removed; a missing file is a no-op. The file-level counterpart to StripManagedBlock (the pure string op).
func RemoveSshConfigInclude ¶ added in v0.2026186.739
RemoveSshConfigInclude removes the managed Include line from ~/.ssh/config. Idempotent.
func RemoveVmSshStanza ¶ added in v0.2026186.739
RemoveVmSshStanza drops the named alias and returns the remaining count (0 → the caller also removes the Include). Idempotent.
func RenderDownloadScript ¶
RenderDownloadScript emits a shell snippet that fetches op.Download to a temp file, optionally extracts it into op.To, then cleans up — honoring the same flags the container build path respects (extract format, strip_components, include, mode, env). candyVars are exported alongside op.Env so a vars: key referenced in the URL resolves at deploy time.
func RenderEnvdBody ¶
RenderEnvdBody produces the deterministic, shell-agnostic POSIX-sh fragment for a candy's env vars + PATH additions. Sorted keys guarantee stable output.
func RenderManagedBlockStrip ¶ added in v0.2026190.848
RenderManagedBlockStrip is the remote analogue of RemoveManagedBlockAt: a POSIX-sh snippet that drops the marker's begin/end fence pair (and its body) from the file IN PLACE on the venue. The fences come from MarkersForTag so they match exactly what the forward walk wrote, and awk index() matches them LITERALLY (no regex). The final `cat > "$f"` rewrites in place to preserve the rc file's perms/owner.
func RenderOpCommand ¶
RenderOpCommand turns an op into a shell command suitable for sudo/user execution. It handles every plugin-renderable verb EXCEPT copy (staged via the executor's PutFile) and the act-`plugin:` verb (whose ProvisionActor shell needs the in-proc registry — package main / RunHostStep render those). Returns (cmd, handled): handled=false means the op is a copy or an act-`plugin:` verb the caller must route elsewhere; handled=true with an empty cmd never occurs (every handled verb yields a body).
func ReplaceOrAppendManagedBlock ¶
ReplaceOrAppendManagedBlock replaces the begin/end fence pair's body (tagged with marker, empty for the global block) in existing, appending a fresh block at EOF when absent.
func ReplaceOrPrependManagedBlock ¶ added in v0.2026186.739
ReplaceOrPrependManagedBlock replaces the marker-tagged managed block in place, or PREPENDS it (with a blank-line separator before the rest of the file) when absent. Used for the ssh-config Include line, which MUST be at the TOP of ~/.ssh/config (outside any Host block) — an appended Include would be gated on the last preceding Host stanza's match (ssh_config(5) lexical scoping).
func ResolveAutoEnable ¶ added in v0.2026190.848
func ResolveDeployPorts ¶ added in v0.2026190.848
func ResolveDeployPorts(containerPorts []int, pins, prior []string, occupied map[int]bool) ([]string, error)
ResolveDeployPorts maps each image-declared container port to a host:container publish mapping — the AUTO-PORT-MAPPING default. For every container port:
- an explicit deploy pin (host:container, matched by container port) wins;
- else a still-valid prior allocation (from a previous `charly config` — keeps a deploy's host ports STABLE across `charly update`) is reused;
- else a fresh free 127.0.0.1 host port is allocated.
`occupied` seeds host ports already taken by SIBLING deployments so concurrent beds never collide; every chosen host port is recorded back into it. Pins for container ports the image does not expose are honored too (an operator publishing an extra port). A stray `auto` token in `pins` is ignored (treated as "no pin" → allocate), so a not-yet-migrated `port: [auto]` still works. Returned mappings carry no bind address; localizePort prepends BindAddress (127.0.0.1 by default) at quadlet/run time so every published port is loopback.
func ResolveEncryptedStoragePath ¶ added in v0.2026190.848
func ResolveEnvVars ¶ added in v0.2026190.848
func ResolveEnvVars(globalEnv []string, deployEnv []string, deployEnvFile string, envDir string, cliEnvFile string, cliEnv []string) ([]string, error)
ResolveEnvVars merges env vars from multiple sources. Priority (last wins for duplicate keys): global env < deploy config < workspace .env < CLI --env-file < CLI -e flags.
func ResolvePackageName ¶
ResolvePackageName picks the correct package name for the running image's distro: if packageMap has a key matching any of the image's distro tags (first match wins — tags are authored most-specific-first, "fedora:43" before "fedora"), that mapping is used; otherwise the bare pkg name. The single cross-distro name resolver shared by the `package` candy's check + act AND the host's step materializer (R3).
func ResolveValue ¶ added in v0.2026190.848
ResolveValue returns the first non-empty value from the chain.
func ResolveVolumesPath ¶ added in v0.2026190.848
func RunCaptureCmd ¶ added in v0.2026190.848
func RunReverseOps ¶ added in v0.2026190.848
func RunReverseOps(ops []ReverseOp, exec ReverseExecutor)
RunReverseOps executes ops in REVERSE order (last-installed, first- removed). Idempotent where possible: a missing file is treated as "already removed" rather than an error.
func SameStringSlice ¶ added in v0.2026190.848
SameStringSlice reports whether two string slices are element-wise equal (order-sensitive) — used to skip a redundant resolved-port re-save.
func SaveRuntimeConfig ¶ added in v0.2026190.848
func SaveRuntimeConfig(cfg *RuntimeConfig) error
SaveRuntimeConfig writes the runtime config file, creating directories as needed.
func SetByDotPath ¶ added in v0.2026186.1019
SetByDotPath edits the file at path, navigating into the YAML structure via dotpath (dot-separated keys) and replacing the leaf value with valueYAML (parsed as YAML so callers can pass scalars, lists, or maps). Comments and key order are preserved.
func ShDoubleQuote ¶
ShDoubleQuote wraps a string in double quotes for a shell context where variable expansion MUST still happen (e.g. download URLs that template ${BUILD_ARCH}). Escapes the metachars that break out of a double-quoted string, but deliberately does NOT escape `$` so authored ${FOO} / $FOO still expand.
func ShDoubleQuotePath ¶
ShDoubleQuotePath escapes a PATH-list value for use INSIDE double quotes, leaving `$` unescaped so `$PATH` expands at sourcing time.
func ShQuoteArg ¶
ShQuoteArg single-quotes an argument for POSIX shell embedding.
func ShQuoteEnv ¶
ShQuoteEnv single-quotes a value for POSIX sh (env.d export values). Inside single quotes nothing needs escaping except the single quote itself.
func ShellInitFilePath ¶
ShellInitFilePath returns the init file the managed block lands in for each shell under a home.
func ShellQuote ¶
ShellQuote wraps s in single quotes for safe interpolation into a shell command (the importable analogue of charly's shellSingleQuote). Embedded single quotes are escaped as '\”.
func SortStrings ¶
func SortStrings(s []string)
SortStrings sorts s in place (ascending). A small insertion-free bubble sort, kept identical to the original package-main helper.
func SshConfigPath ¶ added in v0.2026186.739
SshConfigPath returns ~/.ssh/config for the user's home dir.
func SshFragmentPath ¶ added in v0.2026186.739
SshFragmentPath returns ~/.config/charly/ssh_config for the user's home dir.
func StampDescent ¶ added in v0.2026187.1533
StampDescent stamps node.Descent from node.Target and recurses into the whole nested (Children) + peer (Members) subtree, so every node the deploy chain can descend into carries a descriptor. Idempotent — re-stamping writes the same value.
func StripManagedBlock ¶
StripManagedBlock removes the begin/end fence pair (tagged with marker) and its body.
func StripPortSuffix ¶ added in v0.2026190.848
StripPortSuffix removes /tcp or /udp protocol suffix from a port string. "47998/udp" -> "47998", "udp"; "8000" -> "8000", ""
func SystemdUserAvailable ¶ added in v0.2026190.848
func SystemdUserAvailable() bool
SystemdUserAvailable reports whether a functional `systemd --user` session is reachable for the current process. Both signals must hold:
- $XDG_RUNTIME_DIR is set (the bus address resolves against it)
- /run/user/<uid>/systemd exists as a directory (systemd-user has populated its runtime dir, i.e. the user-instance has actually started)
Either alone is insufficient: $XDG_RUNTIME_DIR can be set in stale environments where systemd-user never came up, and the runtime dir can exist on systems where the env var got dropped (sudo without -E, container entrypoints).
func TaskShellPreamble ¶
TaskShellPreamble returns the BUILD_ARCH/ARCH exports plus any candy vars + op env (sorted for deterministic output) so cmd: bodies can reference ${ARCH} / ${MY_CANDY_VAR} at deploy-time the same way they do at build-time.
func TransferImage ¶ added in v0.2026190.848
TransferImage pipes an image from one engine to another via save | load.
func TransferToRootful ¶ added in v0.2026190.848
TransferToRootful pipes an image from rootless podman storage into rootful (sudo podman) storage via `podman save | sudo podman load`. Idempotent — returns nil immediately when the image already exists in rootful storage.
Used by RunPrivileged when engine.rootful=sudo because rootless and rootful podman maintain separate container-storage trees (~/.local/share/containers vs /var/lib/containers). Without this transfer, sudo podman run against a locally-built image falls back to a registry pull (which 403s for build-only images that were never pushed).
Surfaced 2026-05 by the cachyos / cachyos-pacstrap-builder pair — the first time the bootstrap-builder framework was exercised end-to-end on a host with rootless build + sudo run.
func TrimPreview ¶
TrimPreview truncates s to a 200-char preview (trailing "…") for compact check-output display.
func UserScopeBindMounts ¶ added in v0.2026190.848
UserScopeBindMounts returns the standard subdirs each user-scope builder needs bind-mounted: $HOME/.pixi, $HOME/.cargo, $HOME/.npm-global, $HOME/.cache/charly. Ensures the source dirs exist on the host (empty dirs — so podman's --mount doesn't reject them).
func UserScopeEnv ¶ added in v0.2026190.848
UserScopeEnv returns the env-var set that pixi/npm/cargo need to write into the bind-mounted directories rather than the builder's own home paths.
func ValidateBindAddress ¶ added in v0.2026190.848
func ValidateEngine ¶ added in v0.2026190.848
func ValidateRunMode ¶ added in v0.2026190.848
func VmSshAlias ¶ added in v0.2026186.739
VmSshAlias returns the canonical alias for a VM deployment name ("charly-" namespaced).
func WaitForCloudInit ¶ added in v0.2026186.739
WaitForCloudInit polls `sudo cloud-init status` (as root — charly guests have passwordless sudo) until cloud-init reaches an EXPLICIT terminal status (done/error/disabled) over a SURVIVING ssh connection — that is the deterministic signal that first-boot host-key regen finished (sshd stable) AND the seed-package phase (which holds the distro package lock) completed. Ready ONLY on a terminal token: a blank/transient/"running" read keeps polling, so the deploy's first `pacman -Sy` can't race cloud-final.service. Only meaningful for cloud-image sources; skip for bootc with no cidata ISO.
func WaitForPackageLock ¶ added in v0.2026186.739
WaitForPackageLock makes the guest package manager READY for the deploy's own pacman/apt/dnf: (1) block until no boot-time package PROCESS runs (the direct R4 sync primitive on the contended lock, process-based so a stale lock can't hang it forever), then (2) clear a STALE lock FILE that a reaped boot-time install left with no holding process (re-checking no-process inside the command keeps the removal safe).
func WaitForSSH ¶ added in v0.2026186.739
WaitForSSH polls `ssh <alias> true` until sshd answers (BINARY/EDGE readiness: refused→up), under the injected poll's bounds. ConnectTimeout=2 bounds each connect; ServerAlive* bound a connected-then-blackholed session; the injected poll's per-attempt context is the never-hang bound.
func WalkPlans ¶
func WalkPlans(ctx context.Context, exec DeployExecutor, plans []spec.InstallPlanView, opts WalkOpts) ([]spec.ReverseOp, error)
WalkPlans executes every plan's steps on the venue and returns the combined teardown ops (plugin-renderable kinds echo the host-computed view.ReverseOps; host-engine kinds return theirs from RunHostStep). The caller folds them into its DeployReply.
func WrapContainerCommand ¶
WrapContainerCommand guards an in-container command-check script against stdin-consuming subcommands. The runner delivers in-container scripts to the pod shell over a stdin heredoc ("stdin-attached exec"); without this guard the FIRST subcommand that reads stdin — adb shell, ssh, read, cat — consumes the REST of the heredoc (the not-yet-executed script lines), silently truncating the check to its first command. Wrapping the whole script in a brace group with stdin redirected from /dev/null fixes it generically: the shell reads the entire group before executing it (so the heredoc is fully drained by parse time), then runs every subcommand with stdin tied to /dev/null. The host path (a plain `sh -c` argv) is unaffected.
func WriteCandyRecord ¶ added in v0.2026190.848
func WriteCandyRecord(paths *LedgerPaths, rec *CandyRecord) error
WriteCandyRecord serializes rec to candy/<candy>.json.
func WriteDeployRecord ¶ added in v0.2026190.848
func WriteDeployRecord(paths *LedgerPaths, rec *DeployRecord) error
func WriteDeployRecordVia ¶ added in v0.2026190.848
func WriteDeployRecordVia(exec spec.DeployExecutor, paths *LedgerPaths, rec *DeployRecord) error
WriteDeployRecordVia is the executor-routed variant of WriteDeployRecord. Same semantics as AddCandyDeploymentVia but for deploy records (deploys/<id>.json).
func WriteVmSshStanza ¶ added in v0.2026186.739
func WriteVmSshStanza(home string, s VmSshStanza) error
WriteVmSshStanza adds (or replaces) a Host stanza in the managed fragment. Idempotent.
Types ¶
type BuilderRunOpts ¶ added in v0.2026190.848
type BuilderRunOpts = spec.BuilderRunOpts
type CalVer ¶
type CalVer struct {
Year int // calendar year (e.g. 2026)
Day int // day of year, 1-366
HHMM int // hour*100 + minute, 0-2359
}
CalVer is a parsed YYYY.DDD.HHMM calendar version. The same format that ComputeCalVer (core) emits for image tags is, since the 2026-05 schema-versioning cutover, the schema-version stamp carried by every versioned YAML config. The declarative migration table is ordered by CalVer, and the load-time gate compares a file's CalVer against LatestSchemaVersion.
func LatestSchemaVersion ¶
func LatestSchemaVersion() CalVer
LatestSchemaVersion is the HEAD schema CalVer — every current-format versioned file is stamped to it and the load-time gate requires it. Core exposes it via a thin shim of the same name; the in-core migration engine reads it directly.
func MustCalVer ¶
MustCalVer parses a compile-time-constant CalVer literal, panicking on a malformed value. Used for the CUE-owned HEAD/floor consts (spec.SchemaVersion / spec.SchemaFloor), so a non-canonical literal that slipped past the strict #CanonCalVer CUE gate still fails fast at process start rather than silently mis-ordering the migration table.
func ParseCalVer ¶
ParseCalVer parses the CANONICAL CalVer string "YYYY.DDD.HHMM" — exactly a 4-digit year, a 3-digit zero-padded day-of-year, and a 4-digit zero-padded HHMM, separated by dots. It is EXTREMELY STRICT and has NO backward compatibility: every component must be the exact width, pure ASCII digits (no sign, no inner whitespace), within range (day 1-366, hour 0-23, minute 0-59). Anything else — the legacy integer "4", a non-padded "2026.45.830", an empty string, junk — returns ok=false. (Surrounding whitespace, a transport artifact of e.g. a `charly version` trailing newline, is trimmed before the format check.)
A false result is exactly what the schema gate and migration runner treat as "older than every real CalVer", so a non-canonical config flows into `charly migrate` and is re-stamped canonical — one clean migration forward.
Because the canonical form is fixed-width zero-padded, a plain alphanumeric (lexicographic) sort of CalVer strings is chronological (see CalVer.Less).
func SchemaFloor ¶
func SchemaFloor() CalVer
SchemaFloor is the oldest schema CalVer `charly migrate` can migrate FROM. A config below it (or with a non-CalVer version) is unmigratable — the engine refuses it with an actionable "predates the supported floor" error rather than blind-stamping a stale body to HEAD.
func (CalVer) Less ¶
Less reports whether c is chronologically before o. Because the canonical string form is fixed-width zero-padded, chronological order IS lexicographic order, so this is a plain string comparison.
type CandyRecord ¶ added in v0.2026190.848
type CandyRecord struct {
SchemaVersion string `json:"schema_version,omitempty"`
Candy string `json:"candy"`
Version string `json:"version,omitempty"`
DeployedBy []string `json:"deployed_by"` // set of deploy IDs
DeployedAt string `json:"deployed_at"`
BuilderImage string `json:"builder_image,omitempty"`
Steps []StepRecord `json:"steps,omitempty"` // completed steps, in install order
ReverseOps []ReverseOp `json:"reverse_ops,omitempty"` // precomputed ops for teardown
}
CandyRecord is the per-candy ledger entry. Lists concrete artifacts (packages installed, files written, services enabled, env.d file created, repo changes) so reversal doesn't need to re-compile the plan from the candy manifest.
func ReadCandyRecord ¶ added in v0.2026190.848
func ReadCandyRecord(paths *LedgerPaths, layer string) (*CandyRecord, error)
ReadCandyRecord loads candy/<candy>.json; returns nil, nil if absent.
func RemoveCandyDeployment ¶ added in v0.2026190.848
func RemoveCandyDeployment(paths *LedgerPaths, candyName, deployID string) (*CandyRecord, bool, error)
RemoveCandyDeployment decrements a candy's deployed_by set. Returns (recordAfter, shouldFullyRemove, error). When shouldFullyRemove is true, the caller should perform the actual file/package/service teardown and then delete the candy ledger entry.
type CharlyInstallStrategy ¶ added in v0.2026186.739
type CharlyInstallStrategy string
CharlyInstallStrategy is the resolved charly_install.strategy: "auto" | "scp" | "skip".
const ( CharlyInstallAuto CharlyInstallStrategy = "auto" CharlyInstallScp CharlyInstallStrategy = "scp" CharlyInstallSkip CharlyInstallStrategy = "skip" )
func ResolveCharlyInstallStrategy ¶ added in v0.2026186.739
func ResolveCharlyInstallStrategy(raw string) CharlyInstallStrategy
ResolveCharlyInstallStrategy applies the default to a raw charly_install.strategy string.
type CheckContext ¶
type CheckContext interface {
// Exec runs commands on the venue (in-container under ModeLive, in a disposable
// container under ModeBox, or host-side depending on the executor).
Exec() Executor
// Mode is the run mode (Live vs Box).
Mode() RunMode
// HTTPDo issues an HTTP request from the CHARLY HOST's network namespace, applying
// the per-request TLS / redirect / CA policy in req, and returns the status, body, and
// response headers. It REPLACES the former HTTPClient() *http.Client leg: an
// *http.Client cannot cross a process boundary, so out-of-process the REQUEST crosses
// (CheckContextService.HTTPDo) and the host dials; in-process the host builds the client
// and dials directly. The transport-level error is returned as err (a non-2xx is NOT an
// error — the caller matches resp.Status).
HTTPDo(ctx context.Context, req HTTPRequest) (HTTPResponse, error)
// ResolveEndpoint resolves the check target's venue (container / VM / ssh / local) and
// returns a host-reachable "host:port" address for an in-venue TCP port, opening (and
// host-side tracking, for teardown after this verb's Invoke) any ssh -L forward a VM/ssh
// venue needs. An endpoint verb (cdp/vnc/spice/…) declares its in-venue port and dials
// the returned addr — REPLACING the per-verb host preresolvers: the host owns the
// venue/podman/go-libvirt machinery the out-of-process plugin lacks. Empty addr with a
// nil error means "no live venue" (box-mode / no-box) — the verb's own no-endpoint skip
// then fires; a resolution failure is returned as err.
ResolveEndpoint(ctx context.Context, port int) (addr string, err error)
// ResolveGraphicsEndpoint resolves a VM's <graphics type='<kind>'> listener (kind =
// "vnc" | "spice") to a dialable endpoint, opening (and host-side tracking, for teardown
// after this verb's Invoke) any ssh -L forward + socket->TCP bridge the venue needs. A
// graphics verb (vnc/spice) calls it instead of the removed per-verb host preresolver;
// the host owns the go-libvirt resolution, tunnel, bridge, and credential-store password.
// GraphicsEndpoint.Skip=true means the deployment declares no graphics device of that kind
// (an N/A skip). A zero GraphicsEndpoint with a nil error means no live VM context.
ResolveGraphicsEndpoint(ctx context.Context, kind string) (GraphicsEndpoint, error)
// ResolveClusterContext maps a charly k8s cluster-profile name to its kubeconfig context by
// reading the project's kind:k8s spec — the host owns the project loader the out-of-process
// plugin cannot reach. A cluster-probing verb (kube/…) declares its cluster and gets the
// context; an empty string (no matching profile) means "fall back to the current-context".
ResolveClusterContext(ctx context.Context, cluster string) (kubeContext string, err error)
// ResolveImageLabel reads one OCI label value off the deployment-under-test's image — the
// host owns the podman engine + container→image resolution the out-of-process plugin cannot
// reach. A verb declares the label it needs (mcp reads ai.opencharly.mcp_provide) and parses
// the returned value; an empty string means the label is absent on the image.
ResolveImageLabel(ctx context.Context, label string) (value string, err error)
// DialTimeout is the per-dial ceiling for host-side TCP reachability probes.
DialTimeout() time.Duration
// Box / Instance are the deployment's image + instance names (empty under ModeBox).
Box() string
Instance() string
// Distros is the image's distro tag list (e.g. ["fedora:43","fedora"]) for
// distro-specific package-name resolution.
Distros() []string
// AddBackground registers a host-side background process PID with the active plan run
// so plan teardown reaps it (SIGTERM). A no-op when the engine has no scenario context
// (a bare-Op run) or pid<=0. Used by a verb that fire-and-forgets a host process
// (the `command` verb's background path).
AddBackground(pid int)
}
CheckContext is the live check-engine surface a host-coupled verb's RunVerb consumes. charly's *Runner implements it; a candy reaches the running deployment through it without importing charly's package main.
type CheckVerbProvider ¶
type CheckVerbProvider interface {
Reserved() string
RunVerb(ctx context.Context, cc CheckContext, op *spec.Op) Result
}
CheckVerbProvider is the typed in-process contract a host-coupled check-verb candy implements. Reserved() is the verb word; RunVerb runs the probe against the live CheckContext and returns a Result. The authored plugin_input rides op.PluginInput (decode it into the candy's CUE-generated params struct).
type DeployExecutor ¶
type DeployExecutor interface {
// Venue returns the host executor's stable venue identifier.
Venue(ctx context.Context) (string, error)
// RunSystem runs a root (sudo) script on the venue; optsJSON is a marshalled EmitOpts (nil ok).
RunSystem(ctx context.Context, script string, optsJSON []byte) error
// RunUser runs an unprivileged script on the venue.
RunUser(ctx context.Context, script string, optsJSON []byte) error
// PutFile places content at a path on the venue (ownerRoot → root:root). Binary-safe.
PutFile(ctx context.Context, remotePath string, content []byte, mode uint32, ownerRoot bool) error
// GetFile reads a venue file back to the host (asRoot reads via sudo).
GetFile(ctx context.Context, path string, asRoot bool) ([]byte, error)
// RunCapture runs a command on the venue, returning stdout/stderr/exit separately.
RunCapture(ctx context.Context, script string) (stdout, stderr string, exit int, err error)
// RunHostStep drives a HOST-ENGINE step on the host engine + applies onto the venue,
// returning the step's recorded reverse ops.
RunHostStep(ctx context.Context, step spec.InstallStepView, optsJSON []byte) ([]spec.ReverseOp, error)
}
DeployExecutor is the reverse-channel surface WalkPlans drives. charly's plugin SDK *Executor satisfies it structurally (identical method set), so a plugin passes its sdk.Executor straight through — kit need not import the SDK (no cycle).
type DeployRecord ¶ added in v0.2026190.848
type DeployRecord struct {
// SchemaVersion is the ledger-format version (the ledger-candy-keys
// cutover's CalVer). Empty means a pre-cutover record (json:"layer"
// keys) — the read path rejects it with a `charly migrate` hint.
SchemaVersion string `json:"schema_version,omitempty"`
DeployID string `json:"deploy_id"`
Image string `json:"image"`
Tag string `json:"tag,omitempty"`
Target string `json:"target"` // the deploy-record key, e.g. "vm:<name>" (only VM/local deploys write a DeployRecord)
Candy []string `json:"candy,omitempty"`
AddCandy []string `json:"add_candy,omitempty"`
DeployedAt string `json:"deployed_at"`
}
DeployRecord is the top-level entry in deploys/<deploy-id>.json. Lists the image, tag, and the ordered candy set included in this deploy (image candies + add_candy overlays, already topo-sorted).
func ReadDeployRecord ¶ added in v0.2026190.848
func ReadDeployRecord(paths *LedgerPaths, id string) (*DeployRecord, error)
ReadDeployRecord loads deploys/<deploy-id>.json; returns nil, nil if the file doesn't exist.
type EngineConfig ¶ added in v0.2026190.848
type EngineConfig struct {
Build string `yaml:"build,omitempty" json:"build,omitempty"`
Run string `yaml:"run,omitempty" json:"run,omitempty"`
Rootful string `yaml:"rootful,omitempty" json:"rootful,omitempty"` // "auto", "machine", "sudo", "native"
}
EngineConfig specifies which container engine to use
type EnvConfig ¶ added in v0.2026190.848
type EnvConfig struct {
Vars map[string]string // KEY=value pairs (from env field)
PathAppend []string // PATH append entries (from path_append field)
}
EnvConfig represents environment variables from a candy's manifest
func ExpandEnvConfig ¶ added in v0.2026190.848
ExpandEnvConfig expands all ~ and $HOME references in an EnvConfig
func MergeEnvConfigs ¶ added in v0.2026190.848
MergeEnvConfigs merges multiple env configs, later configs override earlier
type Executor ¶
type Executor interface {
// RunCapture runs a shell command/script on the venue, returning stdout,
// stderr, the exit code, and any execution error (NOT a non-zero exit — that
// is reported via the exit code). No root escalation; callers add sudo.
RunCapture(ctx context.Context, script string) (stdout, stderr string, exit int, err error)
// Kind classifies the venue: "host" | "container" | "image" | "vm".
Kind() string
}
Executor is the subset of charly's DeployExecutor a check verb needs: run one command/script on the venue and capture stdout/stderr/exit separately. charly's DeployExecutor satisfies this structurally (RunCapture + Kind have identical signatures), so *Runner.Exec is passed straight through.
type FetchedImage ¶ added in v0.2026190.848
FetchedImage is the result of FetchQcow2: the absolute path to the cached file plus the resolved sha256 (useful for logging / audit).
func FetchQcow2 ¶ added in v0.2026190.848
func FetchQcow2(src VmSource) (FetchedImage, error)
FetchQcow2 downloads (or reuses a cached copy of) a qcow2 URL, verifying the sha256 checksum. Resumable: partial downloads with a matching Content-Length are continued via Range: bytes=.
If the checksum value is empty, the fetcher attempts to auto-resolve a sidecar file at <url>.SHA256 / .sha256 / .sha256sum (Arch convention is .SHA256). The first one that returns HTTP 200 wins.
type GraphicsEndpoint ¶ added in v0.2026187.2153
type GraphicsEndpoint struct {
Addr string
Socket string
Password string
Skip bool
SkipMessage string
}
GraphicsEndpoint is the resolved, dialable VM graphics endpoint a vnc/spice verb gets from CheckContext.ResolveGraphicsEndpoint. Exactly one of Addr / Socket is set (the host bridges a UNIX socket to TCP for a TCP-only client, or forwards a remote listener, before returning). Password is the resolved ticket ("" = no auth). Skip=true (with SkipMessage) means the deployment declares no graphics device of that kind — an N/A skip, not a failure.
type HTTPRequest ¶
type HTTPRequest struct {
Method string
URL string
Body []byte
Headers map[string]string
Timeout string
AllowInsecure bool
NoFollowRedirects bool
CAPEM []byte
}
HTTPRequest is the host-vantage HTTP request a check verb hands cc.HTTPDo. It carries the FULL request plus the per-request policy the host needs to build the client: Timeout is a Go duration string ("" = the engine's base timeout); CAPEM is the resolved CA PEM bytes (a candy reads its authored ca_file host-side and ships the bytes, so the host server needs no filesystem access). Both placements (in-proc + the CheckContextService RPC) consume the SAME struct.
type HTTPResponse ¶
HTTPResponse is the result of cc.HTTPDo: the status code, the response body, and the response headers as a pre-formatted "Key: value\n" blob (the host formats once — R3 — preserving multi-value headers the matcher pipeline consumes directly). A transport-level failure is returned as the HTTPDo error, not here.
type JumpKind ¶ added in v0.2026190.848
type JumpKind int
JumpKind classifies how NestedExecutor enters the child environment. This determines both the shell-wrapper syntax for RunSystem/RunUser and the file-transport strategy for PutFile.
const ( // JumpPodmanExec enters a rootful or rootless podman container // via `podman exec -i <name>`. The parent must have podman // available (the container-nesting candy provides this for // container-in-container; the virtualization candy is unrelated // here — container children of container parents). JumpPodmanExec JumpKind = iota + 1 // JumpDockerExec enters a docker container via `docker exec -i`. // Separate from podman because docker and podman CLIs differ in // exit-code propagation and stdin handling. JumpDockerExec // JumpSSH makes an additional ssh hop — used when the child // itself is an SSH-reachable VM inside an already-SSH-reachable // parent (vm-in-container, vm-in-vm). JumpSSH // JumpVirshConsole attaches to a libvirt guest's serial console // for emergency-only shell access (used when the guest is // unreachable over SSH). Best-effort; primarily a diagnostic path. JumpVirshConsole // JumpPodmanRun spawns a fresh disposable container per invocation // via `podman run --rm <Target> bash`. Replaces the deleted // ImageExecutor — `charly check box` (build-section) uses this jump // to get the same "ephemeral image probe" semantics through the // unified chain primitive. Each call starts a new container; state // does NOT persist across calls. JumpPodmanRun // JumpDockerRun is the docker counterpart of JumpPodmanRun. JumpDockerRun )
type LedgerLock ¶ added in v0.2026190.848
type LedgerLock struct {
// contains filtered or unexported fields
}
LedgerLock is an acquired advisory lock on the ledger directory. Call Release() when done. Panic-safe via defer.
func AcquireLedgerLock ¶ added in v0.2026190.848
func AcquireLedgerLock(paths *LedgerPaths) (*LedgerLock, error)
AcquireLedgerLock takes a blocking exclusive flock on the ledger lock file via the shared AcquireFileLock primitive (filelock.go). Blocks until the lock is available.
func (*LedgerLock) Release ¶ added in v0.2026190.848
func (l *LedgerLock) Release() error
Release releases the flock and closes the file.
type LedgerPaths ¶ added in v0.2026190.848
type LedgerPaths struct {
Root string // ~/.config/opencharly/installed
Deploys string // <Root>/deploys/
Candies string // <Root>/layers/
LockFile string // <Root>/.lock
}
LedgerPaths describes where ledger files live on disk. Extracted so tests can redirect to a temp dir.
func DefaultLedgerPaths ¶ added in v0.2026190.848
func DefaultLedgerPaths() (*LedgerPaths, error)
DefaultLedgerPaths returns the canonical paths anchored at the invoking user's home directory.
func (*LedgerPaths) Ensure ¶ added in v0.2026190.848
func (p *LedgerPaths) Ensure() error
Ensure creates the ledger directory tree if missing.
type MethodSpec ¶
type MethodSpec struct {
// Path is the `charly check <verb> <method...>` subcommand path.
Path []string
// Required names the plugin-input fields that must be set for this method.
Required []string
// PosArgs builds the positional args inserted after the image name, before -i.
PosArgs func(c *spec.Op) []string
// Artifact marks a state-dependent capture method (screenshot) whose produced
// file is validated.
Artifact bool
// SkipBox = true means the verb targets a cluster/other non-image target, so the
// usual image/deploy-name positional is NOT inserted.
SkipBox bool
}
MethodSpec is one method's nested-CLI dispatch spec: the `charly check <verb> <method...>` subcommand path, the required #Op modifiers, the positional-arg builder, and the artifact / skip-box flags. A plugin's method allowlist is a map[string]MethodSpec; fields are exported so a candy module can author it.
type NestedExecutor ¶ added in v0.2026190.848
type NestedExecutor struct {
Parent spec.DeployExecutor
Jump NestedJump
}
NestedExecutor wraps a parent DeployExecutor and rewrites each DeployExecutor primitive to run inside a nested environment via Jump. Stacks: a NestedExecutor can itself be the Parent of another NestedExecutor, yielding arbitrary-depth composition.
func (*NestedExecutor) GetFile ¶ added in v0.2026190.848
func (n *NestedExecutor) GetFile(ctx context.Context, remotePath string, asRoot bool, opts EmitOpts) ([]byte, error)
GetFile retrieves a file from the nested environment. Current implementation is a minimal read-then-retrieve: the parent shell runs `<jump> cat <path>` and the output is captured via a staged tmp file on the parent venue, then Parent.GetFile pulls it back. Jumps without an obvious cat+stdout path (libvirt-console) return an explicit "not supported" error rather than silently producing empty bytes.
func (*NestedExecutor) Kind ¶ added in v0.2026190.848
func (n *NestedExecutor) Kind() string
Kind reports the venue's coarse classification, derived from the LEAF jump (this NestedExecutor's own Jump). The parent chain doesn't affect Kind because tests care about what their probe lands in, not the path taken to reach it.
func (*NestedExecutor) PutFile ¶ added in v0.2026190.848
func (n *NestedExecutor) PutFile(ctx context.Context, localPath, remotePath string, mode uint32, ownerRoot bool, opts EmitOpts) error
PutFile transfers a file from the invoking host into the nested venue. Implementation picks a FileTransport based on Jump.Kind: podman/docker containers use `<engine> cp`, SSH hops use scp, libvirt console uses virt-copy-in (best effort).
For stacked jumps, the transfer is multi-stage: first land the file at a tmp path on the parent venue (via Parent.PutFile), then issue a one-shot move-into-child command via RunSystem. This preserves the "every executor only knows its own hop" invariant and keeps the FileTransport implementation simple.
func (*NestedExecutor) ResolveHome ¶ added in v0.2026190.848
ResolveHome returns $HOME for `user` inside the leaf environment of this nested executor. Implementation: shell out a small `getent passwd` command via RunCapture (which already routes through the jump chain). Empty user resolves to the leaf-shell's $HOME.
func (*NestedExecutor) RunBuilder ¶ added in v0.2026190.848
func (n *NestedExecutor) RunBuilder(ctx context.Context, opts BuilderRunOpts) ([]byte, error)
RunBuilder always runs on the outermost host (where podman with image-building capabilities lives). Delegates to the parent chain unchanged — nested executors never run builders inside themselves. Artifacts produced by the builder land on the outer host and are distributed to the nested environment via PutFile.
func (*NestedExecutor) RunCapture ¶ added in v0.2026190.848
func (n *NestedExecutor) RunCapture(ctx context.Context, script string) (string, string, int, error)
RunCapture executes a script inside the nested venue and returns stdout/stderr/exit. The wrapped script is forwarded to the parent's own RunCapture, so multi-hop chains compose: harness sandbox (host) → VM (ssh) → inner-pod (podman exec) → nested-pod (podman exec) stacks four heredocs and captures the deepest stdout.
asRoot is hard-coded to false here: test verbs probe state and add `sudo` explicitly when needed (matching the pre-cutover Executor.Exec semantics). Adding root escalation would silently change probe behaviour for every existing test.
func (*NestedExecutor) RunSystem ¶ added in v0.2026190.848
RunSystem routes a bash script through the jump as root.
func (*NestedExecutor) RunUser ¶ added in v0.2026190.848
RunUser runs as the unprivileged user inside the nested environment.
func (*NestedExecutor) Venue ¶ added in v0.2026190.848
func (n *NestedExecutor) Venue() string
Venue returns "nested:<Jump>/<parentVenue>". The parent venue is appended so the full chain is preserved — useful for ledger keying and debug output (e.g. "nested:podman-exec:mychild/ssh://arch@…").
type NestedJump ¶ added in v0.2026190.848
type NestedJump struct {
Kind JumpKind
Target string
// Extra arguments inserted before the shell invocation. Rarely
// needed; useful for `podman exec --env FOO=bar` or
// `ssh -o ProxyJump=…` style tweaks.
ExtraArgs []string
// ProbeName names the disposable container for a JumpPodmanRun/JumpDockerRun
// jump so a probe KILLED before it exits (e.g. by a check ProbeTimeout) can be
// force-reaped instead of orphaning a "Created" container that poisons the
// podman container store. Set per-invocation by NestedExecutor.prepareJump;
// empty for non-disposable jumps.
ProbeName string
}
NestedJump describes one hop into a nested environment. The Target string's meaning depends on Kind:
JumpPodmanExec / JumpDockerExec: container name.
JumpSSH: "[user@]host[:port]" or an
ssh-config alias (e.g.
"charly-<vmname>"). ssh(1) reads
~/.ssh/config + agent for keys
and connection options — we
contain zero credential state.
JumpVirshConsole: libvirt domain name.
func (NestedJump) String ¶ added in v0.2026190.848
func (j NestedJump) String() string
String renders a jump as a human-readable venue segment. Used as a component of NestedExecutor.Venue().
type ParsedPortMapping ¶ added in v0.2026190.848
type ParsedPortMapping struct {
BindAddr string // explicit bind prefix if present (e.g. "127.0.0.1" or "[::1]"); empty otherwise
Host int
Container int
Protocol string // "udp" / "tcp" / "" — extracted from /udp or /tcp suffix
}
ParsedPortMapping describes the four possible shapes podman accepts:
"P" -> {Host: P, Container: P}
"H:C" -> {Host: H, Container: C}
"IP:H:C" -> {Host: H, Container: C, BindAddr: "IP"}
"[v6]:H:C" -> {Host: H, Container: C, BindAddr: "[v6]"}
Any of those forms may carry a /tcp or /udp suffix on the trailing port.
func AllocateAutoPorts ¶ added in v0.2026190.848
func AllocateAutoPorts(containerPorts []int, occupied map[int]bool) ([]ParsedPortMapping, error)
AllocateAutoPorts probes free TCP host ports — one per container port, in declaration order. The `occupied` set names host ports already in use by other deployments (so two `port: [auto]` deploys on the same host don't collide). Returned mappings have BindAddr="" (default host bind) and Protocol="tcp". Each successful allocation is recorded back into `occupied` so subsequent calls in the same BundleConfig pass see the reservation.
Free-port discovery uses the same net.Listen("tcp","127.0.0.1:0") + immediate-close pattern already used by ssh_tunnel.go:78 and vnc_helpers.go's unixToTcpBridge — the OS picks an ephemeral port, we close, and the caller binds in the (small) window before the OS reassigns.
func ParsePortMapping ¶ added in v0.2026190.848
func ParsePortMapping(mapping string) (ParsedPortMapping, bool)
ParsePortMapping is the canonical port-mapping parser.
Returns ok=false on unparseable input. Callers that want a loud failure (warning logged, port skipped) should branch on ok.
All in-tree port handling routes through this — ParseHostPort, ParseContainerPort, parseHostPorts (tunnel.go), buildPortMapping (tunnel.go), and localizePort (shell.go) — so a single fix here covers every site that would otherwise mis-handle the IP:H:C form.
type PollCond ¶ added in v0.2026186.739
PollCond is a per-tick readiness probe (ready?, progress, err) — the same shape the host poll primitive expects.
type PollCondition ¶ added in v0.2026190.848
type PollCondition = vmshared.PollCondition
type PollFunc ¶ added in v0.2026186.739
PollFunc drives a PollCond to readiness under the caller's readiness-configured bounds. Core and the vm plugin inject one wrapping vmshared's pollUntil + the resolved remote bounds, so kit never imports the readiness/poll subsystem.
type PortConflict ¶ added in v0.2026190.848
type PortConflict struct {
HostPort int
ContPort int
Owner string // container name, or "unknown"
OwnerType string // "charly-container", "container", "host-process"
}
PortConflict describes a host port that is already in use.
func CheckPortAvailability ¶ added in v0.2026190.848
func CheckPortAvailability(ports []string, bindAddr string, engine string) []PortConflict
CheckPortAvailability tests whether each host port can be bound. Returns a list of conflicts for ports that are already in use. Detects /udp suffix and uses UDP bind check accordingly.
type ProvisionActor ¶
type ProvisionActor interface {
Reserved() string
RenderProvisionScript(op *spec.Op, distros []string) (script string, ok bool)
}
ProvisionActor is the OPTIONAL second role of a host-coupled verb candy: the do:act renderer for a state-provision verb (kernel_param/mount/user/unix_group/file/command/ service/package), rendering the shell that ENACTS the op under the live init / package manager. It is reached at install COMPILE+EMIT (a `run: {plugin: <verb>}` step → the build-act RUN in emitTasks, and the local/vm deploy act) AND at runtime act. A candy whose verb type implements this ALONGSIDE CheckVerbProvider is registered as a multi-role provider (the host adapter then also satisfies the package-main ProvisionActor). op is the spec.Op (the verb's plugin_input rides op.PluginInput); distros is the image's distro tag list for package-name resolution. Returns (script, ok); ok=false means "no act form for this op" (the host skips/errors per its act path). This is the SHELL-string act role — a verb that instead lowers into a typed InstallPlan step (service/package) additionally needs the kit step contract.
type ResolvedReadiness ¶ added in v0.2026190.848
type ResolvedReadiness = vmshared.ResolvedReadiness
type ResolvedRuntime ¶ added in v0.2026190.848
type ResolvedRuntime struct {
BuildEngine string // "docker" or "podman"
RunEngine string // "docker" or "podman"
Rootful string // "auto", "machine", "sudo", "native"
RunMode string // "direct" or "quadlet"
AutoEnable bool // auto-enable quadlet on first start
BindAddress string // "127.0.0.1" or "0.0.0.0"
EncryptedStoragePath string // path for gocryptfs encrypted storage
VolumesPath string // base path for bind mount volume data
ForwardGpgAgent bool // forward host GPG agent socket into containers
ForwardSshAgent bool // forward host SSH agent socket into containers
VmBackend string // "auto", "libvirt", or "qemu"
}
ResolvedRuntime holds the fully resolved runtime configuration
func ResolveRuntime ¶ added in v0.2026190.848
func ResolveRuntime() (*ResolvedRuntime, error)
ResolveRuntime resolves the runtime configuration: env vars > config file > defaults.
type Result ¶
type Result struct {
Status Status
Message string
CapturedValue string // value stashed under `capture:` (recorded only on PASS)
}
Result is a host-coupled verb's verdict. charly converts it to its internal CheckResult (stamping the Op/Verb/timing) at the dispatch boundary.
type ReverseExecutor ¶ added in v0.2026190.848
type ReverseExecutor interface {
ReverseDryRun() bool
ReverseKeepRepoChanges() bool
ReverseKeepServices() bool
ReverseRunner() ReverseRunner
}
ReverseExecutor is the interface ReverseOp handlers expect. Allows us to pass either BundleDelCmd (for real teardown) or a test mock.
ReverseRunner returns the shell-runner used to execute reversal commands. When non-nil, handlers dispatch through it (so VM teardown runs commands over SSH instead of locally); when nil, handlers fall back to local `exec.Command` — the long-standing host-teardown path.
type ReverseOpKind ¶ added in v0.2026190.848
type ReverseOpKind = spec.ReverseOpKind
type ReverseRunner ¶ added in v0.2026190.848
type ReverseRunner interface {
// RunSystem runs a bash script as root (wraps with sudo on host
// runners; uses `ssh sudo bash -s` on VM runners).
RunSystem(script string) error
// RunUser runs a bash script as the deploy user (no sudo).
RunUser(script string) error
}
ReverseRunner executes reversal shell scripts at the requested privilege level. Implemented by both the local-exec host runner and the SSH-based VM runner (sshReverseRunner, bundle_add_cmd_vm.go).
type RuntimeConfig ¶ added in v0.2026190.848
type RuntimeConfig struct {
Engine EngineConfig `yaml:"engine" json:"engine"`
RunMode string `yaml:"run_mode,omitempty" json:"run_mode,omitempty"`
AutoEnable *bool `yaml:"auto_enable,omitempty" json:"auto_enable,omitempty"`
BindAddress string `yaml:"bind_address,omitempty" json:"bind_address,omitempty"`
EncryptedStoragePath string `yaml:"encrypted_storage_path,omitempty" json:"encrypted_storage_path,omitempty"`
VolumesPath string `yaml:"volumes_path,omitempty" json:"volumes_path,omitempty"`
SecretBackend string `yaml:"secret_backend,omitempty" json:"secret_backend,omitempty"` // "auto", "keyring", "config"
ForwardGpgAgent *bool `yaml:"forward_gpg_agent,omitempty" json:"forward_gpg_agent,omitempty"` // Forward host GPG agent socket into containers (default: true)
ForwardSshAgent *bool `yaml:"forward_ssh_agent,omitempty" json:"forward_ssh_agent,omitempty"` // Forward host SSH agent socket into containers (default: true)
Vm RuntimeVmConfig `yaml:"vm,omitempty" json:"vm,omitempty"`
VncPasswords map[string]string `yaml:"vnc_passwords,omitempty" json:"vnc_passwords,omitempty"` // VNC passwords keyed by image[-instance]
KeyringKeys []string `yaml:"keyring_keys,omitempty" json:"keyring_keys,omitempty"` // Shadow index: names of keys stored in keyring (no values)
KeyringCollectionLabel string `yaml:"keyring_collection_label,omitempty" json:"keyring_collection_label,omitempty"` // Preferred Secret Service collection label; empty means use default alias then iterate.
// HostAliases maps short names (e.g. "o") to SSH targets (e.g.
// "user@o.example.org"). Consulted by charly's --host flag when
// re-execing commands on remote machines. Set via
// `charly settings set hosts.<alias> <ssh-target>`.
HostAliases map[string]string `yaml:"host_aliases,omitempty" json:"host_aliases,omitempty"`
}
RuntimeConfig represents the user-level runtime configuration (~/.config/charly/config.yml)
func LoadRuntimeConfig ¶ added in v0.2026190.848
func LoadRuntimeConfig() (*RuntimeConfig, error)
LoadRuntimeConfig reads the runtime config file. Returns zero-value config if missing.
type RuntimeVmConfig ¶ added in v0.2026190.848
type RuntimeVmConfig struct {
Backend string `yaml:"backend,omitempty" json:"backend,omitempty"` // "auto", "libvirt", "qemu"
DiskSize string `yaml:"disk_size,omitempty" json:"disk_size,omitempty"` // default disk size
RootSize string `yaml:"root_size,omitempty" json:"root_size,omitempty"` // root partition size
Ram string `yaml:"ram,omitempty" json:"ram,omitempty"` // default RAM
Cpus int `yaml:"cpus,omitempty" json:"cpus,omitempty"` // default CPU count
Rootfs string `yaml:"rootfs,omitempty" json:"rootfs,omitempty"` // root filesystem type
Transport string `yaml:"transport,omitempty" json:"transport,omitempty"` // image transport (registry, containers-storage)
}
RuntimeVmConfig holds user-level VM defaults
type SSHArgs ¶ added in v0.2026186.739
SSHArgs is the host-surface ssh/scp coordinates for a managed VM alias.
func (SSHArgs) BaseArgs ¶ added in v0.2026186.739
BaseArgs builds the common ssh invocation prefix: only the per-call ergonomics (LogLevel, ConnectTimeout) + optional Port + pass-through Args + the "user@host"-or-"host" destination (ssh(1) reads ~/.ssh/config + ssh-agent for keys/host-key checking/identity).
func (SSHArgs) ScpBaseArgs ¶ added in v0.2026186.739
ScpBaseArgs builds the scp invocation prefix (scp's `-P` is uppercase vs ssh's lowercase `-p`).
type SSHExecutor ¶ added in v0.2026190.848
type SSHExecutor struct {
// User is the SSH login user. Optional — when empty, ssh(1) reads
// the User directive from ~/.ssh/config or falls back to $USER.
User string
// Host is the SSH target — a hostname, an "[user@]host[:port]"
// destination, or an ssh-config alias (e.g., the "charly-<vmname>"
// stanzas managed by charly vm create). Required.
Host string
// Port is the SSH port. Optional — when 0, ssh uses the Port
// directive from ~/.ssh/config or default 22.
Port int
// Args are extra ssh-cli arguments appended verbatim before the
// destination. Pass-through from the deployment's `ssh_args:` field
// (Ansible's ansible_ssh_extra_args). We do NOT parse, validate,
// or interpret. Use sparingly — ssh-config is the right home for
// persistent options.
Args []string
// ConnectTimeout caps the `-o ConnectTimeout=<N>` used in every
// ssh invocation. Defaults to 10 seconds when zero.
ConnectTimeout int
}
SSHExecutor implements DeployExecutor against an SSH-reachable guest. Used by the external vm deploy to run the same InstallPlan IR that the local deploy target runs — but wrapped as `ssh <user>@<host> sudo bash -s` instead of direct local bash, and scp for file transfers.
The builder-container path (VenueContainerBuilder steps for pixi/npm/cargo/aur) runs on the **host** (where podman is available), and the resulting artifacts are scp'd into the guest via PutFile. This keeps podman out of the guest's dependency surface.
Credential-free by design: SSHExecutor contains zero key paths, zero host-key overrides, zero ssh-agent socket detection. ssh(1) reads ~/.ssh/config and ssh-agent for everything. VMs publish a managed Host stanza into ~/.config/charly/ssh_config (Included from ~/.ssh/config) that names the IdentityFile + UserKnownHostsFile + StrictHostKeyChecking per VM; charly vm create writes the stanza, charly vm destroy removes it.
func (*SSHExecutor) GetFile ¶ added in v0.2026190.848
func (e *SSHExecutor) GetFile(ctx context.Context, remotePath string, asRoot bool, opts EmitOpts) ([]byte, error)
GetFile retrieves the contents of a file from the guest via `ssh <host> [sudo] cat <path>` with stdout captured. asRoot==true wraps the read in sudo so restricted files (e.g. kubeconfig under /etc/rancher) are accessible from the unprivileged SSH user.
func (*SSHExecutor) Kind ¶ added in v0.2026190.848
func (e *SSHExecutor) Kind() string
Kind reports "ssh" — SSHExecutor targets any host reachable over SSH (VMs via the managed charly-<name> aliases, remote machines via "[user@]host[:port]" or ssh-config aliases).
func (*SSHExecutor) PutFile ¶ added in v0.2026190.848
func (e *SSHExecutor) PutFile(ctx context.Context, localPath, remotePath string, mode uint32, ownerRoot bool, opts EmitOpts) error
PutFile copies a local file into the guest via scp, then `install`s it into place with the correct mode/owner. This two-step dance is needed because scp runs as the guest's unprivileged user (you can't scp directly to /usr/local/bin).
ownerRoot decides the PRIVILEGE the install runs at — the SAME contract as ShellExecutor.PutFile (R3): ownerRoot=true → `sudo install -o root -g root` (a system-scoped file, root-owned); ownerRoot=false → a plain user-scoped `install` run AS THE GUEST USER (RunUser, NO sudo) so the file AND any parent dirs `install -D` creates are USER-owned. Running the non-root branch under sudo (the old bug — it always RunSystem'd) created root-owned `~/.config/opencharly/{env.d,…}` in the guest, which then blocked the user-scoped ledger write (`mkdir … Permission denied`). The prior in-proc VM target wrote env.d via RunUser for exactly this reason; the externalized walk reaches the same RunUser path through here.
func (*SSHExecutor) ResolveHome ¶ added in v0.2026190.848
ResolveHome returns $HOME for `user` on the SSH-reachable target. Empty user resolves to whoever ssh logged in as (via `echo $HOME`), non-empty user goes through `getent passwd <user>` so callers can resolve any user's home on the guest.
This replaces the bug where `the local deploy target.HostHome` was initialized from `os.Getenv("HOME")` — the operator's home, not the guest user's. Any subsequent shell-rc edit (env.d sourcing block, new shell:-schema managed-block, etc.) now lands in the right place.
func (*SSHExecutor) RunBuilder ¶ added in v0.2026190.848
func (e *SSHExecutor) RunBuilder(ctx context.Context, opts BuilderRunOpts) ([]byte, error)
RunBuilder delegates to BuilderRun which runs the podman container *on the host*. Caller (the external vm deploy) is responsible for scp-ing the resulting artifacts into the guest via PutFile afterwards — this executor doesn't shuttle artifact trees itself.
func (*SSHExecutor) RunCapture ¶ added in v0.2026190.848
RunCapture executes a script on the guest and returns captured stdout/stderr/exit. Mirrors the deleted VmTestExecutor.Exec semantics: no automatic root escalation (callers that need root prefix sudo).
func (*SSHExecutor) RunSystem ¶ added in v0.2026190.848
RunSystem executes a bash script as root on the guest. Wraps as `ssh vm 'sudo bash -s'` with the script fed on stdin.
func (*SSHExecutor) RunUser ¶ added in v0.2026190.848
RunUser executes a bash script as the guest's unprivileged user (i.e. spec.SSH.User, the account SSHExecutor connects as).
func (*SSHExecutor) SSHBaseArgs ¶ added in v0.2026190.848
func (e *SSHExecutor) SSHBaseArgs() []string
SSHBaseArgs builds the common ssh invocation prefix. ssh(1) reads ~/.ssh/config + ssh-agent for keys, host-key checking, identity files, etc. We supply only the per-call ergonomics (LogLevel, ConnectTimeout) plus optional Port (when caller pre-parsed it from the destination string) plus the deployment's pass-through Args. The destination is "user@host" when User is set, otherwise just Host — letting ssh-config's User directive apply.
func (*SSHExecutor) Venue ¶ added in v0.2026190.848
func (e *SSHExecutor) Venue() string
Venue returns a stable "ssh://<user>@<host>:<port>" identifier so install_ledger.go can scope per-target ledgers without colliding with the local-shell ledger or other SSH targets. Components that are empty stringify naturally ("ssh://server" when User+Port unset).
func (*SSHExecutor) WaitForCloudInit ¶ added in v0.2026190.848
func (e *SSHExecutor) WaitForCloudInit(ctx context.Context) error
WaitForCloudInit polls `sudo cloud-init status` on the guest until cloud-init settles (status done/error/disabled). Only meaningful for cloud-image VMs; callers should skip this for bootc sources with no cidata ISO attached.
func (*SSHExecutor) WaitForPackageLock ¶ added in v0.2026190.848
func (e *SSHExecutor) WaitForPackageLock(ctx context.Context) error
WaitForPackageLock makes the guest package manager READY for a deploy plan's own `pacman -Sy` / `apt` / `dnf`: (1) it blocks until no boot-time package PROCESS is running (cloud-init's first-boot seed-package install holds the lock through cloud-final.service — the direct R4 sync primitive on the contended resource), then (2) it clears a STALE lock FILE left with no holding process. A boot-time pacman is reaped by systemd when cloud-final.service's cgroup is torn down, leaving an empty `/var/lib/pacman/db.lck` that no process owns; pacman then refuses ("unable to lock database") even though nothing is running. Removing a lock NO process holds is the standard, safe stale-lock recovery — gated on a re-check of no-process inside the command so it never races a live transaction. Process-based (not lock-file-based) for the WAIT so a stale lock can't hang the gate forever.
func (*SSHExecutor) WaitForSSH ¶ added in v0.2026190.848
func (e *SSHExecutor) WaitForSSH(ctx context.Context) error
WaitForSSH polls the guest's sshd until it accepts connections (bounded by maxWaitSeconds). Returns nil on first successful connect, error on timeout. Used by the vm deploy's PrepareVenue right after `charly vm create`.
The loop uses a wall-clock deadline (not an iteration count) and a 1-second sleep between attempts. The previous design (300 iterations with no sleep) fast-failed in ~15 seconds when each SSH attempt errored quickly — connection-refused returns in ~50 ms, host-key-mismatch in ~20 ms — burning the entire "300-second budget" in a tiny window. With a 1 s sleep between attempts, slow-to-boot guests get the full polling window they were always supposed to receive. Fixed during the 2026-05-06 R10 follow-up.
type ServicePackagedDesc ¶
ServicePackagedDesc is the candy-decodable construction input for a service-packaged step: the host materializer adds the op-resolved scope + candy name and keeps the load-bearing Reverse() (disable / restore-enabled / remove-dropin) in package main.
type ShellExecutor ¶ added in v0.2026190.848
type ShellExecutor struct{}
ShellExecutor implements DeployExecutor against the invoking user's shell + filesystem. Faithful behavior-preserving wrapper around the existing runSudoShell / runUserShell / BuilderRun helpers.
func (ShellExecutor) GetFile ¶ added in v0.2026190.848
func (ShellExecutor) GetFile(ctx context.Context, remotePath string, asRoot bool, opts EmitOpts) ([]byte, error)
GetFile on the local executor is a direct filesystem read. When asRoot is set, the read is delegated to `sudo cat` so files with restricted permissions (e.g. /etc/shadow, rancher kubeconfig) can still be retrieved. Stdout is captured verbatim.
func (ShellExecutor) Kind ¶ added in v0.2026190.848
func (ShellExecutor) Kind() string
Kind reports "host" — ShellExecutor's commands run on the operator's machine.
func (ShellExecutor) PutFile ¶ added in v0.2026190.848
func (ShellExecutor) PutFile(_ context.Context, localPath, remotePath string, mode uint32, ownerRoot bool, opts EmitOpts) error
PutFile on the local executor is a direct filesystem write. When ownerRoot is set, the installer uses `sudo install -m <mode> -o root -g root` so the target path can be /usr/local/bin or similar.
func (ShellExecutor) ResolveHome ¶ added in v0.2026190.848
ResolveHome returns $HOME for `user` on the local host. Empty user resolves to the invoking operator's $HOME (matches today's `os.Getenv("HOME")` behaviour). Non-empty user goes through `getent passwd <user>` so callers can resolve any user's home.
func (ShellExecutor) RunBuilder ¶ added in v0.2026190.848
func (ShellExecutor) RunBuilder(ctx context.Context, opts BuilderRunOpts) ([]byte, error)
RunBuilder delegates to the package-level BuilderRun.
func (ShellExecutor) RunCapture ¶ added in v0.2026190.848
RunCapture executes a shell command on the local host and returns captured stdout/stderr/exit. Mirrors the deleted ContainerExecutor / ImageExecutor / VmTestExecutor behaviour from the pre-cutover test- time interface — callers (testrun.go verbs) get the same return shape via the unified DeployExecutor interface.
func (ShellExecutor) RunSystem ¶ added in v0.2026190.848
RunSystem delegates to the package-level runSudoShell.
func (ShellExecutor) RunUser ¶ added in v0.2026190.848
RunUser delegates to the package-level runUserShell.
func (ShellExecutor) Venue ¶ added in v0.2026190.848
func (ShellExecutor) Venue() string
Venue returns the fixed "local" identifier — commands always run on the invoking user's host.
type ShellKind ¶
type ShellKind string
ShellKind classifies the venue's login shell.
func DetectShellFromPath ¶
DetectShellFromPath maps a $SHELL path (or shell base name) to a ShellKind. Unknown / empty shells default to bash — the POSIX-safest choice.
type StepDescriptor ¶
type StepDescriptor struct {
ServicePackaged *ServicePackagedDesc
SystemPackages *SystemPackagesDesc
}
StepDescriptor is the candy-decodable construction input for a TYPED install-plan step (the build/deploy install timeline). Exactly one variant is non-nil; the host materializer rebuilds the real package-main InstallStep from it (computing the package-main-only inputs — scope from op.RunAs+img, candy name — and keeping the load-bearing Reverse() in package main, so the candy never imports an IR type).
type StepKindName ¶
type StepKindName string
StepKindName names the TYPED install-plan step a step-providing verb lowers into. The host maps it to its internal StepKind enum; kept a string so the kit need not import charly's package main.
const ( // StepKindServicePackaged — the `service` verb (enable a packaged unit; load-bearing reversals). StepKindServicePackaged StepKindName = "service-packaged" // StepKindSystemPackages — the `package` verb (install system packages). StepKindSystemPackages StepKindName = "system-packages" )
type StepProvider ¶
type StepProvider interface {
StepKind() StepKindName
ConstructStepDescriptor(op *spec.Op) StepDescriptor
}
StepProvider is the OPTIONAL third role of a host-coupled verb candy: a verb whose build/deploy ACT lowers into a TYPED install-plan step (service → service-packaged, package → system-packages) rather than a shell (ProvisionActor) or a generic OpStep. StepKind names the target step (static); ConstructStepDescriptor returns the candy-decodable construction inputs for one op. The host wraps a candy implementing this in an adapter that satisfies package-main's TypedStepProvider, materializing the descriptor into the real IR step.
type StepRecord ¶ added in v0.2026190.848
type StepRecord struct {
Kind StepKind `json:"kind"`
Scope Scope `json:"scope,omitempty"`
Venue Venue `json:"venue,omitempty"`
Summary string `json:"summary,omitempty"`
CompletedAt string `json:"completed_at"`
Extra map[string]string `json:"extra,omitempty"`
}
StepRecord is a thin summary of a completed InstallStep that the ledger keeps for audit. Kept intentionally small — the ReverseOps list on CandyRecord is the source of truth for teardown.
type SystemPackagesDesc ¶
SystemPackagesDesc is the candy-decodable construction input for a system-packages step (the `package` verb): the authored package name + per-distro map. The host materializer resolves the cross-distro name (ResolvePackageName against the image's tags), sets the image format + PhaseInstall, and builds the SystemPackagesStep.
type TagExpr ¶ added in v0.2026191.1413
type TagExpr struct {
// contains filtered or unexported fields
}
TagExpr is an opaque compiled tag expression. Nil means "match everything" (no filter), so callers can write `if expr.Match(tags)` without a nil check.
func CombineTagFilters ¶ added in v0.2026191.1413
CombineTagFilters composes an include-filter and an exclude-filter into one effective expression. Either side may be nil:
- include nil, exclude nil → always matches
- include X, exclude nil → matches when X is true
- include nil, exclude Y → matches when Y is false
- include X, exclude Y → matches when X is true AND Y is false
func ParseTagExpr ¶ added in v0.2026191.1413
ParseTagExpr compiles a tag expression. Empty / whitespace input produces a nil TagExpr that matches everything. A syntax error is returned rather than silently matching or silently failing.
type VmSshStanza ¶ added in v0.2026186.739
type VmSshStanza struct {
Alias string // ssh-config Host alias (e.g. "charly-arch-vm"); unique within the fragment
Hostname string // IP/DNS ssh connects to ("127.0.0.1" for user-mode networking)
Port int // host-side port forwarded to the guest's :22
User string // guest account ssh logs in as
IdentityFile string // absolute private-key path
KnownHostsFile string // absolute per-VM known_hosts path
}
VmSshStanza captures the fields to render one ssh-config Host stanza for a VM.
type WalkOpts ¶
type WalkOpts struct {
// Shell overrides the detected venue login shell for the managed-block finalizer.
Shell ShellKind
// Home overrides the detected venue home. When empty WalkPlans probes `$HOME`.
Home string
}
WalkOpts tunes the walk. All fields optional — WalkPlans probes the venue for the shell + home it needs (the env.d managed-block finalizer) when they are not supplied.
Source Files
¶
- builder.go
- builder_resolve.go
- builder_run.go
- calver.go
- charly_install.go
- container_name.go
- deploy_executor.go
- deploy_executor_nested.go
- deploy_executor_ssh.go
- deploy_host_shell.go
- deploy_types.go
- deployconfig.go
- descent.go
- engine.go
- env.go
- envfile.go
- filelock.go
- http_fetch.go
- images.go
- install_ledger.go
- kit.go
- methodspec.go
- migrate_helpers.go
- migrate_support.go
- ports.go
- profile.go
- readiness.go
- render.go
- reverse_ops.go
- runtime_config.go
- ssh_wait.go
- sshconfig.go
- step_keyword.go
- tagexpr.go
- transfer.go
- walk.go
- yaml.go