yaml: deprecate non-strict YAML#1045
Merged
AkihiroSuda merged 1 commit intolima-vm:masterfrom Sep 8, 2022
Merged
Conversation
Having duplicated keys is now prohibited, but having unsupported keys is still allowed (with deprecation warning) Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
jandubois
approved these changes
Sep 8, 2022
Member
jandubois
left a comment
There was a problem hiding this comment.
LGTM, I'm fine with merging it.
I have 2 observations though, running it against a RD config that has already been updated with socketVMNet support for testing:
$ limactl validate ~/Library/Application\ Support/rancher-desktop/lima/0/lima.yaml
WARN[0000] Non-strict YAML is deprecated and will be unsupported in a future version of Lima comment="main file \"/Users/jan/Library/Application Support/rancher-desktop/lima/0/lima.yaml\"" error="[150:1] unknown field \"k3s\"\n 147 | lima-rancher-desktop: lima-0\n 148 | host.rancher-desktop.internal: host.lima.internal\n 149 | host.docker.internal: host.lima.internal\n > 150 | k3s:\n ^\n 151 | version: 1.24.4"
FATA[0000] failed to load YAML file "/Users/jan/Library/Application Support/rancher-desktop/lima/0/lima.yaml": cannot parse "/Users/jan/.lima/_config/networks.yaml": [15:3] unknown field "socketVMNet"
12 | paths:
13 | # socketVMNet requires Lima >= 0.12 .
14 | # socketVMNet has precedence over vdeVMNet.
> 15 | socketVMNet: /opt/socket_vmnet/bin/socket_vmnet
^
16 | # vdeSwitch and vdeVMNet are DEPRECATED.
17 | vdeSwitch: /opt/vde/bin/vde_switch
18 | vdeVMNet: /opt/vde/bin/vde_vmnet
19 |The WARN output looks a lot less readable than the FATA output, due to the way the errors are reported. I think this is fine though, given that we will make "Strict" the default soon, so the warning will go away again. But if there is an easy fix for this, please apply it!
And the error about networks.yaml should not happen with the release version because by then the socketVMNet support will have been merged as well.
So despite these observations I'm fine with merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Having duplicated keys is now prohibited, but having unsupported keys is still allowed (with deprecation warning)
Fix #1044