Skip to content

Commit bc7788b

Browse files
authored
Merge pull request #2306 from afbjorklund/schema
Add command to generate jsonschema for limayaml
2 parents 7da2a20 + 55224aa commit bc7788b

File tree

14 files changed

+173
-82
lines changed

14 files changed

+173
-82
lines changed

.codespellrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
skip = .git,*.pb.desc,*/node_modules/*,*/public/js/*,*/public/scss/*
77

88
# Comma separated list of words to be ignored. Words must be lowercased.
9-
ignore-words-list = ans,distroname,testof,hda,ststr
9+
ignore-words-list = ans,distroname,testof,hda,ststr,archtypes
1010

1111
# Check file names as well.
1212
check-filenames = true

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
_output/
22
_artifacts/
33
lima.REJECTED.yaml
4+
schema-limayaml.json
45
.config

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,14 @@ ifeq ($(native_compiling),true)
421421
--output _output --prefix $(PREFIX)
422422
endif
423423

424+
################################################################################
425+
schema-limayaml.json: _output/bin/limactl$(exe)
426+
$< generate-jsonschema >$@
427+
428+
.PHONY: check-jsonschema
429+
check-jsonschema: schema-limayaml.json
430+
check-jsonschema --schemafile $< examples/default.yaml
431+
424432
################################################################################
425433
.PHONY: diagrams
426434
diagrams: docs/lima-sequence-diagram.png

cmd/limactl/genschema.go

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package main
2+
3+
import (
4+
"encoding/json"
5+
"fmt"
6+
7+
"github.com/invopop/jsonschema"
8+
"github.com/lima-vm/lima/pkg/limayaml"
9+
"github.com/spf13/cobra"
10+
orderedmap "github.com/wk8/go-ordered-map/v2"
11+
)
12+
13+
func newGenSchemaCommand() *cobra.Command {
14+
genschemaCommand := &cobra.Command{
15+
Use: "generate-jsonschema",
16+
Short: "Generate json-schema document",
17+
Args: WrapArgsError(cobra.NoArgs),
18+
RunE: genschemaAction,
19+
Hidden: true,
20+
}
21+
return genschemaCommand
22+
}
23+
24+
func toAny(args []string) []any {
25+
result := []any{nil}
26+
for _, arg := range args {
27+
result = append(result, arg)
28+
}
29+
return result
30+
}
31+
32+
func getProp(props *orderedmap.OrderedMap[string, *jsonschema.Schema], key string) *jsonschema.Schema {
33+
value, ok := props.Get(key)
34+
if !ok {
35+
return nil
36+
}
37+
return value
38+
}
39+
40+
func genschemaAction(cmd *cobra.Command, _ []string) error {
41+
schema := jsonschema.Reflect(&limayaml.LimaYAML{})
42+
// allow Disk to be either string (name) or object (struct)
43+
schema.Definitions["Disk"].Type = "" // was: "object"
44+
schema.Definitions["Disk"].OneOf = []*jsonschema.Schema{
45+
{Type: "string"},
46+
{Type: "object"},
47+
}
48+
properties := schema.Definitions["LimaYAML"].Properties
49+
getProp(properties, "os").Enum = toAny(limayaml.OSTypes)
50+
getProp(properties, "arch").Enum = toAny(limayaml.ArchTypes)
51+
getProp(properties, "mountType").Enum = toAny(limayaml.MountTypes)
52+
getProp(properties, "vmType").Enum = toAny(limayaml.VMTypes)
53+
j, err := json.MarshalIndent(schema, "", " ")
54+
if err != nil {
55+
return err
56+
}
57+
_, err = fmt.Fprintln(cmd.OutOrStdout(), string(j))
58+
return err
59+
}

cmd/limactl/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ func newApp() *cobra.Command {
150150
newDiskCommand(),
151151
newUsernetCommand(),
152152
newGenDocCommand(),
153+
newGenSchemaCommand(),
153154
newSnapshotCommand(),
154155
newProtectCommand(),
155156
newUnprotectCommand(),

examples/default.yaml

+13-12
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ os: null
3232
arch: null
3333

3434
# OpenStack-compatible disk image.
35-
# 🟢 Builtin default: null (must be specified)
35+
# 🟢 Builtin default: none (must be specified)
3636
# 🔵 This file: Ubuntu images
3737
images:
3838
# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months.
@@ -74,7 +74,7 @@ disk: null
7474
# Expose host directories to the guest, the mount point might be accessible from all UIDs in the guest
7575
# "location" can use these template variables: {{.Home}}, {{.Dir}}, {{.Name}}, {{.UID}}, {{.User}}, and {{.Param.Key}}.
7676
# "mountPoint" can use these template variables: {{.Home}}, {{.Name}}, {{.UID}}, {{.User}}, and {{.Param.Key}}
77-
# 🟢 Builtin default: null (Mount nothing)
77+
# 🟢 Builtin default: [] (Mount nothing)
7878
# 🔵 This file: Mount the home as read-only, /tmp/lima as writable
7979
mounts:
8080
- location: "~"
@@ -123,8 +123,9 @@ mounts:
123123

124124
# List of mount types not supported by the kernel of this distro.
125125
# Also used to resolve the default mount type when not explicitly specified.
126-
# 🟢 Builtin default: null
127-
mountTypesUnsupported: null
126+
# 🟢 Builtin default: []
127+
mountTypesUnsupported:
128+
# - "9p"
128129

129130
# Mount type for above mounts, such as "reverse-sshfs" (from sshocker), "9p" (QEMU’s virtio-9p-pci, aka virtfs),
130131
# or "virtiofs" (experimental on Linux; needs `vmType: vz` on macOS).
@@ -139,7 +140,7 @@ mountInotify: null
139140
# instance, labeled by name. (e.g. if the disk is named "data", it will be labeled
140141
# "lima-data" inside the instance). The disk will be mounted inside the instance at
141142
# `/mnt/lima-${VOLUME}`.
142-
# 🟢 Builtin default: null
143+
# 🟢 Builtin default: []
143144
additionalDisks:
144145
# disks should either be a list of disk name strings, for example:
145146
# - "data"
@@ -222,7 +223,7 @@ containerd:
222223
# Provisioning scripts need to be idempotent because they might be called
223224
# multiple times, e.g. when the host VM is being restarted.
224225
# The scripts can use the following template variables: {{.Home}}, {{.UID}}, {{.User}}, and {{.Param.Key}}
225-
# 🟢 Builtin default: null
226+
# 🟢 Builtin default: []
226227
# provision:
227228
# # `system` is executed with root privileges
228229
# - mode: system
@@ -265,7 +266,7 @@ containerd:
265266
# Probe scripts to check readiness.
266267
# The scripts run in user mode. They must start with a '#!' line.
267268
# The scripts can use the following template variables: {{.Home}}, {{.UID}}, {{.User}}, and {{.Param.Key}}
268-
# 🟢 Builtin default: null
269+
# 🟢 Builtin default: []
269270
# probes:
270271
# # Only `readiness` probes are supported right now.
271272
# - mode: readiness
@@ -352,7 +353,7 @@ video:
352353

353354
# The instance can get routable IP addresses from the vmnet framework using
354355
# https://github.com/lima-vm/socket_vmnet.
355-
# 🟢 Builtin default: null
356+
# 🟢 Builtin default: []
356357
networks:
357358
# Lima can manage daemons for networks defined in $LIMA_HOME/_config/networks.yaml
358359
# automatically. The socket_vmnet binary must be installed into
@@ -435,7 +436,7 @@ networks:
435436
# The same template variables as for listing instances can be used, for example {{.Dir}}.
436437
# You can view the complete list of variables using `limactl list --list-fields` command.
437438
# It also includes {{.HostOS}} and {{.HostArch}} vars, for the runtime GOOS and GOARCH.
438-
# 🟢 Builtin default: null
439+
# 🟢 Builtin default: ""
439440
# message: |
440441
# This will be shown to the user.
441442

@@ -444,7 +445,7 @@ networks:
444445
# to /etc/environment.
445446
# If you set any of "ftp_proxy", "http_proxy", "https_proxy", or "no_proxy", then
446447
# Lima will automatically set an uppercase variant to the same value as well.
447-
# 🟢 Builtin default: null
448+
# 🟢 Builtin default: {}
448449
# env:
449450
# KEY: value
450451

@@ -480,7 +481,7 @@ hostResolver:
480481
# Static names can be defined here as an alternative to adding them to the hosts /etc/hosts.
481482
# Values can be either other hostnames, or IP addresses. The host.lima.internal name is
482483
# predefined to specify the gateway address to the host.
483-
# 🟢 Builtin default: null
484+
# 🟢 Builtin default: {}
484485
hosts:
485486
# guest.name: 127.1.1.1
486487
# host.name: host.lima.internal
@@ -492,7 +493,7 @@ hostResolver:
492493
# that has an IPv4 address, to the list. In case this still doesn't work (e.g. VPN
493494
# setups), the servers can be specified here explicitly. If nameservers are specified
494495
# here, then the configuration from network preferences will be ignored.
495-
# 🟢 Builtin default: null
496+
# 🟢 Builtin default: []
496497
# dns:
497498
# - 1.1.1.1
498499
# - 1.0.0.1

go.mod

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ require (
2424
github.com/goccy/go-yaml v1.12.0
2525
github.com/google/go-cmp v0.6.0
2626
github.com/google/yamlfmt v0.13.0
27+
github.com/invopop/jsonschema v0.12.0
2728
github.com/lima-vm/go-qcow2reader v0.2.0
2829
github.com/lima-vm/sshocker v0.3.4
2930
github.com/mattn/go-isatty v0.0.20
@@ -39,6 +40,7 @@ require (
3940
github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af
4041
github.com/spf13/cobra v1.8.1
4142
github.com/spf13/pflag v1.0.5
43+
github.com/wk8/go-ordered-map/v2 v2.1.8
4244
golang.org/x/net v0.30.0
4345
golang.org/x/sync v0.8.0
4446
golang.org/x/sys v0.26.0
@@ -57,8 +59,10 @@ require (
5759
github.com/VividCortex/ewma v1.2.0 // indirect
5860
github.com/a8m/envsubst v1.4.2 // indirect
5961
github.com/alecthomas/participle/v2 v2.1.1 // indirect
62+
github.com/bahlo/generic-list-go v0.2.0 // indirect
6063
github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
6164
github.com/braydonk/yaml v0.7.0 // indirect
65+
github.com/buger/jsonparser v1.1.1 // indirect
6266
github.com/containerd/errdefs v0.3.0 // indirect
6367
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
6468
github.com/digitalocean/go-libvirt v0.0.0-20220804181439-8648fbde413e // indirect

go.sum

+8
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW5
2323
github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU=
2424
github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc=
2525
github.com/armon/go-proxyproto v0.0.0-20210323213023-7e956b284f0a/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU=
26+
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
27+
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
2628
github.com/balajiv113/fd v0.0.0-20230330094840-143eec500f3e h1:IdMhFPEfTZQU971tIHx3UhY4l+yCeynprnINrDTSrOc=
2729
github.com/balajiv113/fd v0.0.0-20230330094840-143eec500f3e/go.mod h1:aXGMJsd3XrnUFTuyf/pTGg5jG6CY8JMZ5juywvShjgQ=
2830
github.com/bmatcuk/doublestar/v4 v4.6.0 h1:HTuxyug8GyFbRkrffIpzNCSK4luc0TY3wzXvzIZhEXc=
2931
github.com/bmatcuk/doublestar/v4 v4.6.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
3032
github.com/braydonk/yaml v0.7.0 h1:ySkqO7r0MGoCNhiRJqE0Xe9yhINMyvOAB3nFjgyJn2k=
3133
github.com/braydonk/yaml v0.7.0/go.mod h1:hcm3h581tudlirk8XEUPDBAimBPbmnL0Y45hCRl47N4=
34+
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
35+
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
3236
github.com/cheggaaa/pb/v3 v3.1.5 h1:QuuUzeM2WsAqG2gMqtzaWithDJv0i+i6UlnwSCI4QLk=
3337
github.com/cheggaaa/pb/v3 v3.1.5/go.mod h1:CrxkeghYTXi1lQBEI7jSn+3svI3cuc19haAj6jM60XI=
3438
github.com/containerd/containerd v1.7.23 h1:H2CClyUkmpKAGlhQp95g2WXHfLYc7whAuvZGBNYOOwQ=
@@ -142,6 +146,8 @@ github.com/inetaf/tcpproxy v0.0.0-20240214030015-3ce58045626c h1:gYfYE403/nlrGNY
142146
github.com/inetaf/tcpproxy v0.0.0-20240214030015-3ce58045626c/go.mod h1:Di7LXRyUcnvAcLicFhtM9/MlZl/TNgRSDHORM2c6CMI=
143147
github.com/insomniacslk/dhcp v0.0.0-20240710054256-ddd8a41251c9 h1:LZJWucZz7ztCqY6Jsu7N9g124iJ2kt/O62j3+UchZFg=
144148
github.com/insomniacslk/dhcp v0.0.0-20240710054256-ddd8a41251c9/go.mod h1:KclMyHxX06VrVr0DJmeFSUb1ankt7xTfoOA35pCkoic=
149+
github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI=
150+
github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0=
145151
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
146152
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
147153
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
@@ -272,6 +278,8 @@ github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 h1:pyC9PaHYZFgEKFdlp3G8
272278
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701/go.mod h1:P3a5rG4X7tI17Nn3aOIAYr5HbIMukwXG0urG0WuL8OA=
273279
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
274280
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
281+
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
282+
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
275283
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
276284
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
277285
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

pkg/cidata/cidata.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func templateArgs(bootScripts bool, instDir, name string, instConfig *limayaml.L
202202
if err != nil {
203203
return nil, err
204204
}
205-
mountPoint, err := localpathutil.Expand(f.MountPoint)
205+
mountPoint, err := localpathutil.Expand(*f.MountPoint)
206206
if err != nil {
207207
return nil, err
208208
}

pkg/hostagent/mount.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (a *HostAgent) setupMount(m limayaml.Mount) (*mount, error) {
3737
return nil, err
3838
}
3939

40-
mountPoint, err := localpathutil.Expand(m.MountPoint)
40+
mountPoint, err := localpathutil.Expand(*m.MountPoint)
4141
if err != nil {
4242
return nil, err
4343
}

pkg/limayaml/defaults.go

+9-7
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,12 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
619619
} else {
620620
logrus.WithError(err).Warnf("Couldn't process mount location %q as a template", mount.Location)
621621
}
622-
if out, err := executeGuestTemplate(mount.MountPoint, instDir, y.Param); err == nil {
623-
mount.MountPoint = out.String()
624-
} else {
625-
logrus.WithError(err).Warnf("Couldn't process mount point %q as a template", mount.MountPoint)
622+
if mount.MountPoint != nil {
623+
if out, err := executeGuestTemplate(*mount.MountPoint, instDir, y.Param); err == nil {
624+
mount.MountPoint = ptr.Of(out.String())
625+
} else {
626+
logrus.WithError(err).Warnf("Couldn't process mount point %q as a template", *mount.MountPoint)
627+
}
626628
}
627629
if i, ok := location[mount.Location]; ok {
628630
if mount.SSHFS.Cache != nil {
@@ -652,7 +654,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
652654
if mount.Writable != nil {
653655
mounts[i].Writable = mount.Writable
654656
}
655-
if mount.MountPoint != "" {
657+
if mount.MountPoint != nil {
656658
mounts[i].MountPoint = mount.MountPoint
657659
}
658660
} else {
@@ -695,8 +697,8 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
695697
mounts[i].NineP.Cache = ptr.Of(Default9pCacheForRO)
696698
}
697699
}
698-
if mount.MountPoint == "" {
699-
mounts[i].MountPoint = mount.Location
700+
if mount.MountPoint == nil {
701+
mounts[i].MountPoint = ptr.Of(mount.Location)
700702
}
701703
}
702704

pkg/limayaml/defaults_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func TestFillDefault(t *testing.T) {
132132
},
133133
Mounts: []Mount{
134134
{Location: "/tmp"},
135-
{Location: "{{.Dir}}/{{.Param.ONE}}", MountPoint: "/mnt/{{.Param.ONE}}"},
135+
{Location: "{{.Dir}}/{{.Param.ONE}}", MountPoint: ptr.Of("/mnt/{{.Param.ONE}}")},
136136
},
137137
MountType: ptr.Of(NINEP),
138138
Provision: []Provision{
@@ -205,7 +205,7 @@ func TestFillDefault(t *testing.T) {
205205
}
206206

207207
expect.Mounts = slices.Clone(y.Mounts)
208-
expect.Mounts[0].MountPoint = expect.Mounts[0].Location
208+
expect.Mounts[0].MountPoint = ptr.Of(expect.Mounts[0].Location)
209209
expect.Mounts[0].Writable = ptr.Of(false)
210210
expect.Mounts[0].SSHFS.Cache = ptr.Of(true)
211211
expect.Mounts[0].SSHFS.FollowSymlinks = ptr.Of(false)
@@ -217,7 +217,7 @@ func TestFillDefault(t *testing.T) {
217217
expect.Mounts[0].Virtiofs.QueueSize = nil
218218
// Only missing Mounts field is Writable, and the default value is also the null value: false
219219
expect.Mounts[1].Location = fmt.Sprintf("%s/%s", instDir, y.Param["ONE"])
220-
expect.Mounts[1].MountPoint = fmt.Sprintf("/mnt/%s", y.Param["ONE"])
220+
expect.Mounts[1].MountPoint = ptr.Of(fmt.Sprintf("/mnt/%s", y.Param["ONE"]))
221221
expect.Mounts[1].Writable = ptr.Of(false)
222222
expect.Mounts[1].SSHFS.Cache = ptr.Of(true)
223223
expect.Mounts[1].SSHFS.FollowSymlinks = ptr.Of(false)
@@ -431,7 +431,7 @@ func TestFillDefault(t *testing.T) {
431431
expect.Containerd.Archives = slices.Clone(d.Containerd.Archives)
432432
expect.Containerd.Archives[0].Arch = *d.Arch
433433
expect.Mounts = slices.Clone(d.Mounts)
434-
expect.Mounts[0].MountPoint = expect.Mounts[0].Location
434+
expect.Mounts[0].MountPoint = ptr.Of(expect.Mounts[0].Location)
435435
expect.Mounts[0].SSHFS.Cache = ptr.Of(true)
436436
expect.Mounts[0].SSHFS.FollowSymlinks = ptr.Of(false)
437437
expect.Mounts[0].SSHFS.SFTPDriver = ptr.Of("")

0 commit comments

Comments
 (0)