From cb41c4cf9b1c03bc9f96e9a3210ac77bd88829c9 Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Sat, 27 Sep 2025 23:01:24 -0700 Subject: [PATCH] Add meta field to lima.yaml for user annotations 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 #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 --- pkg/driver/vz/vz_driver_darwin.go | 1 + pkg/driver/wsl2/wsl_driver_windows.go | 1 + pkg/limatype/lima_yaml.go | 11 ++++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pkg/driver/vz/vz_driver_darwin.go b/pkg/driver/vz/vz_driver_darwin.go index ec901b73227..c75a0048b1d 100644 --- a/pkg/driver/vz/vz_driver_darwin.go +++ b/pkg/driver/vz/vz_driver_darwin.go @@ -45,6 +45,7 @@ var knownYamlProperties = []string{ "Images", "Memory", "Message", + "Meta", "MinimumLimaVersion", "Mounts", "MountType", diff --git a/pkg/driver/wsl2/wsl_driver_windows.go b/pkg/driver/wsl2/wsl_driver_windows.go index ae8252b1639..e1c098154e5 100644 --- a/pkg/driver/wsl2/wsl_driver_windows.go +++ b/pkg/driver/wsl2/wsl_driver_windows.go @@ -35,6 +35,7 @@ var knownYamlProperties = []string{ "HostResolver", "Images", "Message", + "Meta", "Mounts", "MountType", "Param", diff --git a/pkg/limatype/lima_yaml.go b/pkg/limatype/lima_yaml.go index 367f5bc9887..eb7c5ac224c 100644 --- a/pkg/limatype/lima_yaml.go +++ b/pkg/limatype/lima_yaml.go @@ -52,11 +52,12 @@ type LimaYAML struct { PropagateProxyEnv *bool `yaml:"propagateProxyEnv,omitempty" json:"propagateProxyEnv,omitempty" jsonschema:"nullable"` CACertificates CACertificates `yaml:"caCerts,omitempty" json:"caCerts,omitempty"` // Deprecated: Use VMOpts.VZ.Rosetta instead. - Rosetta Rosetta `yaml:"rosetta,omitempty" json:"rosetta,omitempty"` - Plain *bool `yaml:"plain,omitempty" json:"plain,omitempty" jsonschema:"nullable"` - 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"` + Rosetta Rosetta `yaml:"rosetta,omitempty" json:"rosetta,omitempty"` + Plain *bool `yaml:"plain,omitempty" json:"plain,omitempty" jsonschema:"nullable"` + 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"` } type BaseTemplates []LocatorWithDigest