Documentation
¶
Overview ¶
Package ocispec turns run parameters into the OCI runtime spec that vminitd executes (via vmexec) inside the microVM. It is deliberately VM-independent pure logic — no vsock, no Code-Hex/vz — so it unit-tests as a black box.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidUser = errors.New("invalid user specification")
ErrInvalidUser indicates the process user string is not a supported numeric uid[:gid]. ossein does not resolve names against the guest /etc/passwd.
Functions ¶
func Build ¶
Build assembles the OCI runtime spec handed to vminitd. There is no network namespace: the microVM is the network boundary, so the container must see the guest's eth0 directly.
func Command ¶
Command merges the image config with a user override, docker-style: a non-empty override replaces Cmd; Entrypoint is always preserved.
func Marshal ¶
Marshal serializes the OCI spec for vminitd's Swift decoder. Most of their structs decode leniently (decodeIfPresent), but LinuxNamespace is synthesized Codable and requires the "path" key — which Go's specs-go drops via omitempty when empty. Patch it in post-marshal. The intermediate decode uses UseNumber so large int64s (e.g. RLIM_INFINITY in rlimits) survive the round-trip instead of losing precision as float64.