Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add save functionality to limayaml #2338

Merged
merged 1 commit into from May 20, 2024

Conversation

afbjorklund
Copy link
Contributor

Make it possible to fill in the defaults (null) with limactl validate, with a workaround for python yaml.

Was using a local patched version to test with the jsonschema and such, might as well be a flag ?

You can validate more than one yaml, then the output will be formatted with document separators.

limactl validate examples/default.yaml examples/ubuntu.yaml


Found an interesting python bug (libyaml difference?), when using check-jsonschema:

Schema validation errors were encountered.
  default.yaml::$.mounts[0].location: None is not of type 'string'
mounts:
- location: ~
  mountPoint: ~
  writable: false
  sshfs:
    cache: true
    followSymlinks: false
    sftpDriver: ""
  9p:
    securityModel: none
    protocolVersion: 9p2000.L
    msize: 128KiB
    cache: fscache
- location: /tmp/lima
  mountPoint: /tmp/lima
  writable: true
  sshfs:
    cache: true
    followSymlinks: false
    sftpDriver: ""
  9p:
    securityModel: none
    protocolVersion: 9p2000.L
    msize: 128KiB
    cache: mmap

Added a workaround, not sure which language is "right" according to yaml spec ?

@afbjorklund
Copy link
Contributor Author

afbjorklund commented May 12, 2024

According to yaml.org, ~ is the representation of the null value. It is not a valid string.

There is a similar go-yaml bug (similar to "~"), if you try to marshal the string "null"

Make it possible to fill in the defaults (null) with
limactl validate, with a workaround for go-yaml null.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@afbjorklund
Copy link
Contributor Author

afbjorklund commented May 12, 2024

There are some minor differences between this output and the limactl info output (as JSON)

Due to the difference in sequence indentation, and to the missing default for Virtiofs on Linux/9p.

@@ -33,6 +33,7 @@
     protocolVersion: 9p2000.L
     msize: 128KiB
     cache: fscache
+    virtiofs: {}
 - location: /tmp/lima
   mountPoint: /tmp/lima
   writable: true
@@ -45,6 +46,7 @@
     protocolVersion: 9p2000.L
     msize: 128KiB
     cache: mmap
+    virtiofs: {}
 mountType: reverse-sshfs
 mountInotify: false
 ssh:

commit 8b7bab1 (limactl info | jq .defaultTemplate | yq -p json). Only in experimental:

--- default.yaml
+++ virtiofs-linux.yaml
@@ -33,6 +33,8 @@
     protocolVersion: 9p2000.L
     msize: 128KiB
     cache: fscache
+  virtiofs:
+    queueSize: 1024
 - location: /tmp/lima
   mountPoint: /tmp/lima
   writable: true
@@ -45,7 +47,9 @@
     protocolVersion: 9p2000.L
     msize: 128KiB
     cache: mmap
-mountType: reverse-sshfs
+  virtiofs:
+    queueSize: 1024
+mountType: virtiofs
 mountInotify: false
 ssh:
   localPort: 0

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda added this to the v0.23.0 (tentative) milestone May 20, 2024
@AkihiroSuda AkihiroSuda merged commit 67802ed into lima-vm:master May 20, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants