File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,16 @@ func loadCache() {
132
132
if cache .err != nil {
133
133
return
134
134
}
135
- cache .err = yaml .UnmarshalWithOptions (b , & cache .config , yaml .Strict ())
135
+ cache .err = yaml .UnmarshalWithOptions (b , & cache .config , yaml .DisallowDuplicateKey ())
136
136
if cache .err != nil {
137
137
cache .err = fmt .Errorf ("cannot parse %q: %w" , configFile , cache .err )
138
+ return
139
+ }
140
+ var strictConfig YAML
141
+ if strictErr := yaml .UnmarshalWithOptions (b , & strictConfig , yaml .Strict ()); strictErr != nil {
142
+ // Allow non-existing YAML fields, as a config created with Lima < v0.22 contains `vdeSwitch` and `vdeVMNet`.
143
+ // These fields were removed in Lima v0.22.
144
+ logrus .WithError (strictErr ).Warn ("Non-strict YAML is deprecated and will be unsupported in a future version of Lima: " + configFile )
138
145
}
139
146
cache .config , cache .err = fillDefaults (cache .config )
140
147
if cache .err != nil {
You can’t perform that action at this time.
0 commit comments