Skip to content

Conversation

jandubois
Copy link
Member

@jandubois jandubois commented Sep 28, 2025

This field will not be used by Lima itself; users can add whatever objects they want.

Possible uses are:


I first called the field metadata, but it just feels too long, especially since in filter expressions it becomes .config.metadata.

It is unfortunate that most of the interesting data for filtering in the list command is inside the .config object, making all expressions longer and harder to read. The .name and .status properties are about the only things outside of .config that I regularly use.

This field will not be used by Lima itself; users can add whatever
objects they want.

Possible uses are:

* adding labels that can be used as selectors (see also lima-vm#3240)

  limactl edit mysql --set '.meta.database = true'
  limactl list --yq 'select(.config.meta.database).name'

* adding anything that would normally be just a comment, like a description or keywords

Signed-off-by: Jan Dubois <[email protected]>
TimeZone *string `yaml:"timezone,omitempty" json:"timezone,omitempty" jsonschema:"nullable"`
NestedVirtualization *bool `yaml:"nestedVirtualization,omitempty" json:"nestedVirtualization,omitempty" jsonschema:"nullable"`
User User `yaml:"user,omitempty" json:"user,omitempty"`
Meta map[string]any `yaml:"meta,omitempty" json:"meta,omitempty" jsonschema:"nullable"`
Copy link
Member

Choose a reason for hiding this comment

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

FillDefault needs to be updated for overriding

Copy link
Member

Choose a reason for hiding this comment

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

Bikeshedding: why not call this "labels"

Copy link
Member Author

Choose a reason for hiding this comment

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

Bikeshedding: why not call this "labels"

  1. Because I think of the value of labels as just strings (map[string]string), not objects, and I don't want to put any constraints on the data a user wants to put there.

  2. I find meta more generic than labels, e.g. meta.keywords looks better to me than labels.keywords. And with point (1), meta.keywords can be a []string, but labels.keywords would be a comma-separated list that would need to be parsed and could not be used easily with jq/yq.

Copy link
Member Author

Choose a reason for hiding this comment

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

FillDefault needs to be updated for overriding

I guess. And then it also should be supported by template embedding, for consistency.

At first I thought since Lima doesn't use the value of Meta, just declaring the field to make sure we don't get strict YAML errors would be enough. But I guess I was wrong. 😄

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.

2 participants