-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconfig.go
More file actions
52 lines (43 loc) · 1.9 KB
/
config.go
File metadata and controls
52 lines (43 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Package vmconfig defines the configuration schema passed from host to guest VM.
package vmconfig
// Config is the configuration passed to the guest init binary via config.json.
// This struct is serialized by the host (lib/instances/configdisk.go) and
// deserialized by the guest init binary (lib/system/init).
type Config struct {
// Container execution parameters
Entrypoint []string `json:"entrypoint"`
Cmd []string `json:"cmd"`
Workdir string `json:"workdir"`
// Environment variables
Env map[string]string `json:"env"`
// Network configuration
NetworkEnabled bool `json:"network_enabled"`
GuestIP string `json:"guest_ip,omitempty"`
GuestCIDR int `json:"guest_cidr,omitempty"`
GuestGW string `json:"guest_gw,omitempty"`
GuestDNS string `json:"guest_dns,omitempty"`
// Volume mounts
VolumeMounts []VolumeMount `json:"volume_mounts,omitempty"`
// Init mode: "exec" (default) or "systemd"
InitMode string `json:"init_mode"`
// Boot optimizations
SkipKernelHeaders bool `json:"skip_kernel_headers,omitempty"`
SkipGuestAgent bool `json:"skip_guest_agent,omitempty"`
// Optional egress MITM proxy configuration.
EgressProxy *EgressProxyConfig `json:"egress_proxy,omitempty"`
}
// VolumeMount represents a volume mount configuration.
type VolumeMount struct {
Device string `json:"device"`
Path string `json:"path"`
Mode string `json:"mode"` // "ro", "rw", "overlay", or "nfs"
OverlayDevice string `json:"overlay_device,omitempty"`
NFSHost string `json:"nfs_host,omitempty"` // Host IP for NFS mount (mode=nfs)
NFSExport string `json:"nfs_export,omitempty"` // Export path on host (mode=nfs)
}
// EgressProxyConfig configures guest-side trust and proxy endpoint wiring.
type EgressProxyConfig struct {
Enabled bool `json:"enabled"`
ProxyURL string `json:"proxy_url"`
CACertPEM string `json:"ca_cert_pem,omitempty"`
}