Skip to content

Commit

Permalink
Improve the limayaml and default.yaml syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
  • Loading branch information
afbjorklund committed Apr 30, 2024
1 parent 541eb2d commit a9983ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions examples/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ containerd:
# Setting of instructions is supported like this: "qemu64,+ssse3".
cpuType:
# 🟢 Builtin default: "cortex-a72" (or "host" when running on aarch64 host)
aarch64: null
aarch64: ""
# 🟢 Builtin default: "cortex-a7" (or "host" when running on armv7l host)
armv7l: null
armv7l: ""
# 🟢 Builtin default: "qemu64" (or "host,-pdpe1gb" when running on x86_64 host)
x86_64: null
x86_64: ""

rosetta:
# Enable Rosetta for Linux (EXPERIMENTAL).
Expand Down
22 changes: 11 additions & 11 deletions pkg/limayaml/limayaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
)

type LimaYAML struct {
VMType *VMType `yaml:"vmType,omitempty" json:"vmType,omitempty"`
OS *OS `yaml:"os,omitempty" json:"os,omitempty"`
Arch *Arch `yaml:"arch,omitempty" json:"arch,omitempty"`
VMType *VMType `yaml:"vmType,omitempty" json:"vmType,omitempty" jsonschema:"nullable"`
OS *OS `yaml:"os,omitempty" json:"os,omitempty" jsonschema:"nullable"`
Arch *Arch `yaml:"arch,omitempty" json:"arch,omitempty" jsonschema:"nullable"`
Images []Image `yaml:"images" json:"images"` // REQUIRED
CPUType map[Arch]string `yaml:"cpuType,omitempty" json:"cpuType,omitempty"`
CPUs *int `yaml:"cpus,omitempty" json:"cpus,omitempty"`
Memory *string `yaml:"memory,omitempty" json:"memory,omitempty"` // go-units.RAMInBytes
Disk *string `yaml:"disk,omitempty" json:"disk,omitempty"` // go-units.RAMInBytes
CPUs *int `yaml:"cpus,omitempty" json:"cpus,omitempty" jsonschema:"nullable"`
Memory *string `yaml:"memory,omitempty" json:"memory,omitempty" jsonschema:"nullable"` // go-units.RAMInBytes
Disk *string `yaml:"disk,omitempty" json:"disk,omitempty" jsonschema:"nullable"` // go-units.RAMInBytes
AdditionalDisks []Disk `yaml:"additionalDisks,omitempty" json:"additionalDisks,omitempty"`
Mounts []Mount `yaml:"mounts,omitempty" json:"mounts,omitempty"`
MountType *MountType `yaml:"mountType,omitempty" json:"mountType,omitempty"`
Expand Down Expand Up @@ -181,7 +181,7 @@ const (
)

type Provision struct {
Mode ProvisionMode `yaml:"mode" json:"mode"` // default: "system"
Mode ProvisionMode `yaml:"mode,omitempty" json:"mode,omitempty" jsonschema:"default=system"`
SkipDefaultDependencyResolution *bool `yaml:"skipDefaultDependencyResolution,omitempty" json:"skipDefaultDependencyResolution,omitempty"`
Script string `yaml:"script" json:"script"`
}
Expand All @@ -199,10 +199,10 @@ const (
)

type Probe struct {
Mode ProbeMode // default: "readiness"
Description string
Script string
Hint string
Mode ProbeMode `yaml:"mode,omitempty" json:"mode,omitempty" jsonschema:"default=readiness"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Script string `yaml:"script,omitempty" json:"script,omitempty"`
Hint string `yaml:"hint,omitempty" json:"hint,omitempty"`
}

type Proto = string
Expand Down

0 comments on commit a9983ec

Please sign in to comment.