You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logrus.Warnf("field `audio.device` must be \"vz\", \"default\", or \"none\" for VZ driver, got %q", audioDevice)
}
I think all the warning should return an error instead (but in a separate PR).
I also think limaDriver.Validate() should be called as part of limayaml.Validate() or through some wrapper that will call both. Calling it as part of instance.Prepare() is too late.
An alternative would be to move most or all of the driver-based validation into limayaml.Validate.
The logic is already leaking into that function e.g. in #1951 in the code that selects the default vmType based on all the other settings. So the knowledge about which settings are compatible with which driver already lives there. Moving the rest of the driver validation into the same function just consolidates all of it into a single place.
I understand that conceptually having a separate per-driver validation function is desirable if/when we ever support external (non-builtin) drivers, but we don't have them currently.
I just noticed that some driver-specific settings are not validated at all. E.g.
$ limactl start --vm-type qemu --set .rosetta.enabled=true
? Creating an instance "default" Proceed with the current configuration
INFO[0001] Starting the instance "default" with VM driver "qemu"
…
$ yq .rosetta ~/.lima/default/lima.yaml
# Enable Rosetta for Linux (EXPERIMENTAL).# Hint: try `softwareupdate --install-rosetta` if Lima gets stuck at `Installing rosetta...`# 🟢 Builtin default: false
enabled: true
…
will not even show a warning; the Rosetta setting is just silently ignored by the QEMU driver.
I think this is just another argument in favour of merging all validation into limayaml.Validate().
@afbjorklund Yes, they can. The warning comes from
func (l *LimaVzDriver) Validate() error {
and just write to the log, but don't return an error:lima/pkg/vz/vz_driver_darwin.go
Lines 134 to 139 in 374db8b
I think all the warning should return an error instead (but in a separate PR).
I also think
limaDriver.Validate()
should be called as part oflimayaml.Validate()
or through some wrapper that will call both. Calling it as part ofinstance.Prepare()
is too late.Originally posted by @jandubois in #1951 (comment)
The text was updated successfully, but these errors were encountered: