Skip to content
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

Silence WARN[0000] vmType vz: ignoring networks[0]: [Metric] #3010

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

jandubois
Copy link
Member

Fix #2986

@jandubois jandubois added this to the v1.0.3 milestone Dec 11, 2024
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit af60ff7 into lima-vm:master Dec 11, 2024
29 checks passed
@jandubois jandubois deleted the metric branch December 11, 2024 17:26
@@ -130,6 +130,7 @@ func (l *LimaVzDriver) Validate() error {
"Lima",
"Socket",
"MACAddress",
"Metric",
"Interface",
); len(unknown) > 0 {
logrus.Warnf("vmType %s: ignoring networks[%d]: %+v", *l.Instance.Config.VMType, i, unknown)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is easy to grep for the warning text and understand why it happens but the warning should make it clear that this is a validation warning, and the issue is unknown property. Maybe something like:

validate vmType vz: ignoring unknown property networks[1]: "Metric"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

If you are going to work on this, you should also take a look at the corresponding code in the pkg/wsl2/wsl_driver_windows.go file to try to keep things in sync (I noticed vz uses ignoring while wsl2 uses Ignoring, which caused me to miss them on my initial grepping).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course validation is going to be a big rabbit hole; look at #2512 for more thoughts on how it should be refactored.

Personally I don't want to touch it (validation) until I had a chance to replace the current FillDefaults with the upcoming code from template assembly because that might change things around anyways.

Copy link
Member

@nirs nirs Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have time for this now, added #3011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v1.0.1: WARN[0000] vmType vz: ignoring networks[0]: [Metric]
3 participants