-
Notifications
You must be signed in to change notification settings - Fork 624
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
Call limadriver.Validate
as part of limayaml.Validate
#2512
Comments
An alternative would be to move most or all of the driver-based validation into The logic is already leaking into that function e.g. in #1951 in the code that selects the default 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 |
@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: