Skip to content

Call limadriver.Validate as part of limayaml.Validate #2512

@jandubois

Description

@jandubois
          > They can return errors in validation, instead of warnings?

@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:

switch audioDevice := *l.Yaml.Audio.Device; audioDevice {
case "":
case "vz", "default", "none":
default:
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.

Originally posted by @jandubois in #1951 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions