Documentation
¶
Index ¶
- Constants
- func Bootstrap(stateDir string) (err error)
- func Teardown(stateDir string) error
- type ImageConfig
- type Manager
- func (m *Manager) ExtractImageConfig(ctx context.Context, imageRef string) (*ImageConfig, error)
- func (m *Manager) InjectGuestAgent(ctx context.Context, vmID, hostBinaryPath, guestPath string) error
- func (m *Manager) Snapshot(ctx context.Context, vmID, imageRef string) (string, error)
- func (m *Manager) Teardown(ctx context.Context, vmID string) error
- func (m *Manager) WarmImage(ctx context.Context, imageRef string) error
Constants ¶
const DefaultGuestAgentPath = "/usr/local/bin/herd-guest-agent"
DefaultGuestAgentPath is where the binary is placed inside the VM rootfs and must match the kernel boot arg init=...
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ImageConfig ¶
ImageConfig holds the default container execution parameters.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager mediates between herd and containerd for rootfs provisioning.
Lifecycle:
- Call WarmImage on demand to pull/cache an image.
- Call Snapshot per-VM to create a copy-on-write block device from the cached image.
- Call Teardown per-VM when the VM is destroyed.
func NewManager ¶
func NewManager(client *containerd.Client, namespace, snapshotter string) *Manager
func (*Manager) ExtractImageConfig ¶
ExtractImageConfig asks containerd to parse the OCI image metadata and returns the default Entrypoint, Cmd, and Env baked into the image.
func (*Manager) InjectGuestAgent ¶
func (m *Manager) InjectGuestAgent(ctx context.Context, vmID, hostBinaryPath, guestPath string) error
InjectGuestAgent mounts the snapshot's root filesystem on the host, copies a static herd-guest-agent binary into the image, then unmounts. Required for initrd-less boot (kernel runs init from ext4).
func (*Manager) Snapshot ¶
Snapshot creates a copy-on-write devmapper thin-volume for a single VM, derived from the parent image cached by WarmImage.
It returns the host path to the block device (e.g. /dev/dm-X). This is a pure local operation — no registry or network calls.
func (*Manager) Teardown ¶
Teardown safely releases the VM's lease, allowing containerd's garbage collector to destroy the block device.