Skip to content

Commit a9983ec

Browse files
committed
Improve the limayaml and default.yaml syntax
Signed-off-by: Anders F Björklund <[email protected]>
1 parent 541eb2d commit a9983ec

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

examples/default.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,11 @@ containerd:
254254
# Setting of instructions is supported like this: "qemu64,+ssse3".
255255
cpuType:
256256
# 🟢 Builtin default: "cortex-a72" (or "host" when running on aarch64 host)
257-
aarch64: null
257+
aarch64: ""
258258
# 🟢 Builtin default: "cortex-a7" (or "host" when running on armv7l host)
259-
armv7l: null
259+
armv7l: ""
260260
# 🟢 Builtin default: "qemu64" (or "host,-pdpe1gb" when running on x86_64 host)
261-
x86_64: null
261+
x86_64: ""
262262

263263
rosetta:
264264
# Enable Rosetta for Linux (EXPERIMENTAL).

pkg/limayaml/limayaml.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import (
77
)
88

99
type LimaYAML struct {
10-
VMType *VMType `yaml:"vmType,omitempty" json:"vmType,omitempty"`
11-
OS *OS `yaml:"os,omitempty" json:"os,omitempty"`
12-
Arch *Arch `yaml:"arch,omitempty" json:"arch,omitempty"`
10+
VMType *VMType `yaml:"vmType,omitempty" json:"vmType,omitempty" jsonschema:"nullable"`
11+
OS *OS `yaml:"os,omitempty" json:"os,omitempty" jsonschema:"nullable"`
12+
Arch *Arch `yaml:"arch,omitempty" json:"arch,omitempty" jsonschema:"nullable"`
1313
Images []Image `yaml:"images" json:"images"` // REQUIRED
1414
CPUType map[Arch]string `yaml:"cpuType,omitempty" json:"cpuType,omitempty"`
15-
CPUs *int `yaml:"cpus,omitempty" json:"cpus,omitempty"`
16-
Memory *string `yaml:"memory,omitempty" json:"memory,omitempty"` // go-units.RAMInBytes
17-
Disk *string `yaml:"disk,omitempty" json:"disk,omitempty"` // go-units.RAMInBytes
15+
CPUs *int `yaml:"cpus,omitempty" json:"cpus,omitempty" jsonschema:"nullable"`
16+
Memory *string `yaml:"memory,omitempty" json:"memory,omitempty" jsonschema:"nullable"` // go-units.RAMInBytes
17+
Disk *string `yaml:"disk,omitempty" json:"disk,omitempty" jsonschema:"nullable"` // go-units.RAMInBytes
1818
AdditionalDisks []Disk `yaml:"additionalDisks,omitempty" json:"additionalDisks,omitempty"`
1919
Mounts []Mount `yaml:"mounts,omitempty" json:"mounts,omitempty"`
2020
MountType *MountType `yaml:"mountType,omitempty" json:"mountType,omitempty"`
@@ -181,7 +181,7 @@ const (
181181
)
182182

183183
type Provision struct {
184-
Mode ProvisionMode `yaml:"mode" json:"mode"` // default: "system"
184+
Mode ProvisionMode `yaml:"mode,omitempty" json:"mode,omitempty" jsonschema:"default=system"`
185185
SkipDefaultDependencyResolution *bool `yaml:"skipDefaultDependencyResolution,omitempty" json:"skipDefaultDependencyResolution,omitempty"`
186186
Script string `yaml:"script" json:"script"`
187187
}
@@ -199,10 +199,10 @@ const (
199199
)
200200

201201
type Probe struct {
202-
Mode ProbeMode // default: "readiness"
203-
Description string
204-
Script string
205-
Hint string
202+
Mode ProbeMode `yaml:"mode,omitempty" json:"mode,omitempty" jsonschema:"default=readiness"`
203+
Description string `yaml:"description,omitempty" json:"description,omitempty"`
204+
Script string `yaml:"script,omitempty" json:"script,omitempty"`
205+
Hint string `yaml:"hint,omitempty" json:"hint,omitempty"`
206206
}
207207

208208
type Proto = string

0 commit comments

Comments
 (0)