@@ -7,24 +7,24 @@ import (
77)
88
99type LimaYAML struct {
10- Arch Arch `yaml:"arch,omitempty"`
11- Images []File `yaml:"images"` // REQUIRED
12- CPUs int `yaml:"cpus,omitempty"`
13- Memory string `yaml:"memory,omitempty"` // go-units.RAMInBytes
14- Disk string `yaml:"disk,omitempty"` // go-units.RAMInBytes
15- Mounts []Mount `yaml:"mounts,omitempty"`
16- SSH SSH `yaml:"ssh,omitempty"` // REQUIRED (FIXME)
17- Firmware Firmware `yaml:"firmware,omitempty"`
18- Video Video `yaml:"video,omitempty"`
19- Provision []Provision `yaml:"provision,omitempty"`
20- Containerd Containerd `yaml:"containerd,omitempty"`
21- Probes []Probe `yaml:"probes,omitempty"`
22- PortForwards []PortForward `yaml:"portForwards,omitempty"`
23- Networks []Network `yaml:"networks,omitempty"`
24- Network NetworkDeprecated `yaml:"network,omitempty"` // DEPRECATED, use `networks` instead
25- Env map [string ]string `yaml:"env,omitempty"`
26- DNS []net.IP `yaml:"dns,omitempty"`
27- UseHostResolver * bool `yaml:"useHostResolver,omitempty"`
10+ Arch Arch `yaml:"arch,omitempty" json:"arch,omitempty" `
11+ Images []File `yaml:"images" json:"images" ` // REQUIRED
12+ CPUs int `yaml:"cpus,omitempty" json:"cpus,omitempty" `
13+ Memory string `yaml:"memory,omitempty" json:"memory,omitempty" ` // go-units.RAMInBytes
14+ Disk string `yaml:"disk,omitempty" json:"disk,omitempty"` // go-units.RAMInBytes
15+ Mounts []Mount `yaml:"mounts,omitempty" json:"mounts,omitempty" `
16+ SSH SSH `yaml:"ssh,omitempty" json:"ssh,omitempty" ` // REQUIRED (FIXME)
17+ Firmware Firmware `yaml:"firmware,omitempty" json:"firmware,omitempty" `
18+ Video Video `yaml:"video,omitempty" json:"video,omitempty" `
19+ Provision []Provision `yaml:"provision,omitempty" json:"provision,omitempty" `
20+ Containerd Containerd `yaml:"containerd,omitempty" json:"containerd,omitempty" `
21+ Probes []Probe `yaml:"probes,omitempty" json:"probes,omitempty" `
22+ PortForwards []PortForward `yaml:"portForwards,omitempty" json:"portForwards,omitempty" `
23+ Networks []Network `yaml:"networks,omitempty" json:"networks,omitempty" `
24+ Network NetworkDeprecated `yaml:"network,omitempty" json:"network,omitempty" ` // DEPRECATED, use `networks` instead
25+ Env map [string ]string `yaml:"env,omitempty" json:"env,omitempty" `
26+ DNS []net.IP `yaml:"dns,omitempty" json:"dns,omitempty" `
27+ UseHostResolver * bool `yaml:"useHostResolver,omitempty" json:"useHostResolver,omitempty" `
2828}
2929
3030type Arch = string
@@ -35,33 +35,33 @@ const (
3535)
3636
3737type File struct {
38- Location string `yaml:"location"` // REQUIRED
39- Arch Arch `yaml:"arch,omitempty"`
40- Digest digest.Digest `yaml:"digest,omitempty"`
38+ Location string `yaml:"location" json:"location" ` // REQUIRED
39+ Arch Arch `yaml:"arch,omitempty" json:"arch,omitempty" `
40+ Digest digest.Digest `yaml:"digest,omitempty" json:"digest,omitempty" `
4141}
4242
4343type Mount struct {
44- Location string `yaml:"location"` // REQUIRED
45- Writable bool `yaml:"writable,omitempty"`
44+ Location string `yaml:"location" json:"location" ` // REQUIRED
45+ Writable bool `yaml:"writable,omitempty" json:"writable,omitempty" `
4646}
4747
4848type SSH struct {
49- LocalPort int `yaml:"localPort,omitempty"` // REQUIRED (FIXME: auto assign)
49+ LocalPort int `yaml:"localPort,omitempty" json:"localPort,omitempty" ` // REQUIRED (FIXME: auto assign)
5050
5151 // LoadDotSSHPubKeys loads ~/.ssh/*.pub in addition to $LIMA_HOME/_config/user.pub .
5252 // Default: true
53- LoadDotSSHPubKeys * bool `yaml:"loadDotSSHPubKeys,omitempty"`
53+ LoadDotSSHPubKeys * bool `yaml:"loadDotSSHPubKeys,omitempty" json:"loadDotSSHPubKeys,omitempty" `
5454}
5555
5656type Firmware struct {
5757 // LegacyBIOS disables UEFI if set.
5858 // LegacyBIOS is ignored for aarch64.
59- LegacyBIOS bool `yaml:"legacyBIOS,omitempty"`
59+ LegacyBIOS bool `yaml:"legacyBIOS,omitempty" json:"legacyBIOS,omitempty" `
6060}
6161
6262type Video struct {
6363 // Display is a QEMU display string
64- Display string `yaml:"display,omitempty"`
64+ Display string `yaml:"display,omitempty" json:"display,omitempty" `
6565}
6666
6767type ProvisionMode = string
@@ -72,13 +72,14 @@ const (
7272)
7373
7474type Provision struct {
75- Mode ProvisionMode `yaml:"mode"` // default: "system"
76- Script string `yaml:"script"`
75+ Mode ProvisionMode `yaml:"mode" json:"mode" ` // default: "system"
76+ Script string `yaml:"script" json:"script" `
7777}
7878
7979type Containerd struct {
80- System * bool `yaml:"system,omitempty"` // default: false
81- User * bool `yaml:"user,omitempty"` // default: true
80+ System * bool `yaml:"system,omitempty" json:"system,omitempty"` // default: false
81+ User * bool `yaml:"user,omitempty" json:"user,omitempty"` // default: true
82+ Archives []File `yaml:"archives,omitempty" json:"archives,omitempty"` // default: see defaultContainerdArchives
8283}
8384
8485type ProbeMode = string
@@ -101,25 +102,25 @@ const (
101102)
102103
103104type PortForward struct {
104- GuestIP net.IP `yaml:"guestIP,omitempty"`
105- GuestPort int `yaml:"guestPort,omitempty"`
106- GuestPortRange [2 ]int `yaml:"guestPortRange,omitempty"`
107- HostIP net.IP `yaml:"hostIP,omitempty"`
108- HostPort int `yaml:"hostPort,omitempty"`
109- HostPortRange [2 ]int `yaml:"hostPortRange,omitempty"`
110- Proto Proto `yaml:"proto,omitempty"`
111- Ignore bool `yaml:"ignore,omitempty"`
105+ GuestIP net.IP `yaml:"guestIP,omitempty" json:"guestIP,omitempty" `
106+ GuestPort int `yaml:"guestPort,omitempty" json:"guestPort,omitempty" `
107+ GuestPortRange [2 ]int `yaml:"guestPortRange,omitempty" json:"guestPortRange,omitempty" `
108+ HostIP net.IP `yaml:"hostIP,omitempty" json:"hostIP,omitempty" `
109+ HostPort int `yaml:"hostPort,omitempty" json:"hostPort,omitempty" `
110+ HostPortRange [2 ]int `yaml:"hostPortRange,omitempty" json:"hostPortRange,omitempty" `
111+ Proto Proto `yaml:"proto,omitempty" json:"proto,omitempty" `
112+ Ignore bool `yaml:"ignore,omitempty" json:"ignore,omitempty" `
112113}
113114
114115type Network struct {
115116 // `Lima` and `VNL` are mutually exclusive; exactly one is required
116- Lima string `yaml:"lima,omitempty"`
117+ Lima string `yaml:"lima,omitempty" json:"lima,omitempty" `
117118 // VNL is a Virtual Network Locator (https://github.com/rd235/vdeplug4/commit/089984200f447abb0e825eb45548b781ba1ebccd).
118119 // On macOS, only VDE2-compatible form (optionally with vde:// prefix) is supported.
119- VNL string `yaml:"vnl,omitempty"`
120- SwitchPort uint16 `yaml:"switchPort,omitempty"` // VDE Switch port, not TCP/UDP port (only used by VDE networking)
121- MACAddress string `yaml:"macAddress,omitempty"`
122- Interface string `yaml:"interface,omitempty"`
120+ VNL string `yaml:"vnl,omitempty" json:"vnl,omitempty" `
121+ SwitchPort uint16 `yaml:"switchPort,omitempty" json:"switchPort,omitempty" ` // VDE Switch port, not TCP/UDP port (only used by VDE networking)
122+ MACAddress string `yaml:"macAddress,omitempty" json:"macAddress,omitempty" `
123+ Interface string `yaml:"interface,omitempty" json:"interface,omitempty" `
123124}
124125
125126// DEPRECATED types below
@@ -128,14 +129,14 @@ type Network struct {
128129// and to avoid accidental usage in new code.
129130
130131type NetworkDeprecated struct {
131- VDEDeprecated []VDEDeprecated `yaml:"vde,omitempty"`
132+ VDEDeprecated []VDEDeprecated `yaml:"vde,omitempty" json:"vde,omitempty" `
132133 // migrate will be true when `network.VDE` has been copied to `networks` by FillDefaults()
133134 migrated bool
134135}
135136
136137type VDEDeprecated struct {
137- VNL string `yaml:"vnl,omitempty"`
138- SwitchPort uint16 `yaml:"switchPort,omitempty"` // VDE Switch port, not TCP/UDP port
139- MACAddress string `yaml:"macAddress,omitempty"`
140- Name string `yaml:"name,omitempty"`
138+ VNL string `yaml:"vnl,omitempty" json:"vnl,omitempty" `
139+ SwitchPort uint16 `yaml:"switchPort,omitempty" json:"switchPort,omitempty" ` // VDE Switch port, not TCP/UDP port
140+ MACAddress string `yaml:"macAddress,omitempty" json:"macAddress,omitempty" `
141+ Name string `yaml:"name,omitempty" json:"name,omitempty" `
141142}
0 commit comments