Documentation
¶
Overview ¶
Package daemon holds the full sandboxd boot sequence as a single reusable entrypoint, Run. The open-source cmd/sandboxd calls Run with a no-op control plane (controlplane.Noop()); a managed build calls the same Run with a provider backed by the private fleet client. Keeping boot in one exported function is what lets the managed binary reuse the entire daemon without forking main().
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run loads configuration and executes the full daemon boot sequence, blocking until ctx is cancelled (SIGINT/SIGTERM in the standard wrapper), then performs graceful shutdown. Every fatal boot failure is returned as a wrapped error rather than calling os.Exit; the thin main() wrapper turns a non-nil return into the exit(1) the historical main() did, so observable behavior is unchanged (process dies on boot failure) while the boot-failure paths stay testable. Returning also lets the deferred cleanup (store/mount/otel shutdown) run on failure, which os.Exit skipped. The returned error covers every boot phase; it is nil at graceful shutdown.
makeProvider supplies the control-plane capabilities. nil (the open-source default) means controlplane.Noop(): every non-PAT token rejected, every usage report a no-op, every create admitted, no enforcement loop.
Types ¶
type FleetConfig ¶
FleetConfig is the subset of daemon configuration a control-plane provider needs, projected out of the internal config so a managed build can construct its provider without importing internal/config (which Go forbids across modules). It mirrors the SB_FLEET_* settings.
type ProviderFactory ¶
type ProviderFactory func(ctx context.Context, fc FleetConfig) (controlplane.Provider, error)
ProviderFactory builds the control-plane provider from the resolved fleet config. The managed build supplies one (wiring the private avmctl client); the open-source build passes nil, which yields controlplane.Noop(). It receives ctx so a provider can start background work (e.g. contract refresh) bound to the daemon lifecycle.
Source Files
¶
- block_sets_wiring.go
- cloud_identity_wiring.go
- container_engine_wiring.go
- containerd_netns_wiring.go
- containerd_warm_wiring.go
- create_policy_wiring.go
- daemon.go
- docker_bridge_slots.go
- docker_netns_wiring.go
- docker_warm_wiring.go
- egress_operator_wiring.go
- egress_procid_wiring.go
- egress_wiring.go
- firecracker_adopt.go
- firecracker_egress_wiring.go
- firecracker_images.go
- identity_guard.go
- identity_wiring.go
- ingress_routing_wiring.go
- ipv6_fence_wiring.go
- isolate_wiring.go
- liveness.go
- network_policy_wiring.go
- node_guard_wiring.go
- ondemand_tls_gate.go
- pkcs11.go
- protocols.go
- public_socket.go
- wasm_wiring.go