Documentation
¶
Overview ¶
Package provision is funcd's TEMPORARY container-runtime self-provisioning (ADR-0056): `funcd install` downloads the pinned, SHA-256-verified static binaries the managed-containerd path needs — crun (the OCI runtime the runc-v2 shim execs), containerd (+ its runc-v2 shim + ctr), and the CNI plugins — laying crun/containerd into funcd's bin dir and the CNI plugins into /opt/cni/bin. It is the interim stand-in for ADR-0054's bundled-release embed; its exit criterion is shipping those bytes funcd built.
Security model (the load-bearing property): every asset is read FULLY into memory, its SHA-256 is compared to the pinned digest, and ONLY on a match is anything written/chmod'd to disk. A mismatch returns a fault.Invalid error having written nothing — no unverified bytes ever land on disk or run as root.
Stdlib only (no new Go module): net/http + crypto/sha256 + archive/tar + compress/gzip.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LayDown ¶
LayDown downloads each pinned asset for the host arch, verifies its SHA-256 BEFORE any chmod/exec, then installs it. Idempotent: an asset already present at its pinned version is skipped. A checksum mismatch returns fault.Invalid and installs NOTHING (no partial state, no chmod, no exec). binDir/cniDir are the destinations.
Types ¶
type Asset ¶
type Asset struct {
Name string // "crun" | "containerd" | "cni-plugins"
Version string // pinned, e.g. "1.28"
URLFor func(arch string) string // arch ∈ {"amd64","arm64"}
SHA256 map[string]string // arch → hex digest (verified before Install)
Install func(data []byte, binDir, cniDir string) error
// contains filtered or unexported fields
}
Asset is a pinned, checksum-verified downloadable runtime binary/tarball. Install is a PER-ASSET closure encoding the asset's shape — a lone binary (chmod 0755 into binDir), or an untar selecting named members to their dests. It runs ONLY after the SHA-256 of data matched the pin.