Documentation
¶
Overview ¶
Package lima renders and validates the Lima template for the managed VM.
Index ¶
Constants ¶
const ( DefaultMemoryMiB = 3072 DefaultCPUs = 2 DefaultDiskGiB = 30 DefaultMemoryMinMiB = 2048 DefaultMemoryMaxPercent = 50 DefaultCPUMin = 1 DefaultDiskMinGiB = 10 DefaultDiskMaxGiB = 1024 DefaultDashboardGuest = 8080 DefaultIngressGuest = 80 )
Defaults block (ADR 070 table). Nothing else in this package holds a limit.
const ( // ImageSHAEnv overrides the digest of the image for the chosen arch. TESTING // only: production code must not set it. ImageSHAEnv = "APP_VM_IMAGE_SHA256" )
Pinned Ubuntu 26.04 LTS cloud images. Digests are the publisher's SHA-256; a bump ships with a real-Mac isolation check.
Variables ¶
This section is empty.
Functions ¶
func CheckHome ¶
CheckHome refuses a Lima home that carries default.yaml or override.yaml: Lima merges them into every instance and override wins, so they could add mounts, wildcard forwards or agent forwarding. Call it before create and start.
func ImageOverrideFromEnv ¶
func ImageOverrideFromEnv() string
ImageOverrideFromEnv reads APP_VM_IMAGE_SHA256 for RenderOptions. Testing only.
Types ¶
type Image ¶
type Image struct {
Location string `yaml:"location"`
Arch string `yaml:"arch"`
Digest string `yaml:"digest"`
}
Image is one pinned guest image entry.
type Limits ¶
type Limits struct {
MemoryMinMiB int
MemoryMaxMiB int
CPUMin int
CPUMax int
DiskMinGiB int
DiskMaxGiB int
HomeDir string
DataDir string
}
Limits bounds Settings. HomeDir and DataDir guard the share check.
func DefaultLimits ¶
DefaultLimits derives limits from the host. maxPercent comes from APP_VM_MEMORY_MAX_PERCENT and falls back to the ADR default when zero.
type RenderOptions ¶
type RenderOptions struct {
// Arch is "aarch64" or "x86_64". Empty means aarch64.
Arch string
// ImageSHA256Override replaces the pinned digest for Arch. Testing only.
ImageSHA256Override string
}
RenderOptions carries caller choices that are not VM settings.
type Settings ¶
type Settings struct {
MemoryMiB int
CPUs int
DiskGiB int
DashboardPort int
IngressPort int
DashboardGuestPort int
IngressGuestPort int
Sidecar guest.Sidecar
Guest guest.Options
}
Settings is everything the template needs. Ports are host loopback ports.
func DefaultSettings ¶
func DefaultSettings() Settings
DefaultSettings returns the ADR defaults with unset (zero) host ports.