feat(template): support template-less image variant selection#5159
Open
Nachiket-Roy wants to merge 1 commit into
Open
feat(template): support template-less image variant selection#5159Nachiket-Roy wants to merge 1 commit into
Nachiket-Roy wants to merge 1 commit into
Conversation
4acd3b1 to
282433b
Compare
Member
There should be lima/cmd/limactl/editflags/editflags.go Line 99 in 4d1c1b2 |
AkihiroSuda
reviewed
Jun 27, 2026
AkihiroSuda
reviewed
Jun 27, 2026
AkihiroSuda
reviewed
Jun 27, 2026
There was a problem hiding this comment.
Pull request overview
Adds first-class support for selecting OS image “variants” (e.g., Ubuntu minimal, Debian nocloud) without multiplying template files, by tagging image entries with a variant and enabling CLI-based filtering while preserving existing default image selection behavior.
Changes:
- Add
varianttolimatype.Imageand propagate acceptance of the field through driver config validation. - Introduce
--image-variantflag (implemented via yq expression) to select a specific image variant at instance creation. - Update Ubuntu/Debian image catalogs to include variant-tagged entries and add tests to validate unmarshalling and default ordering.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/_images/ubuntu-26.04.yaml | Adds variant: server entries and introduces minimal variant images (with fallback). |
| templates/_images/ubuntu-24.04.yaml | Adds variant: server entries and introduces minimal variant images (with fallback). |
| templates/_images/ubuntu-22.04.yaml | Adds variant: server entries and introduces minimal variant images (amd64). |
| templates/_images/debian-13.yaml | Tags existing images as genericcloud/generic and adds nocloud variant images (with fallback). |
| templates/_images/debian-12.yaml | Tags existing images as genericcloud/generic and adds nocloud variant images (with fallback). |
| pkg/limayaml/defaults_test.go | Adds tests for variant unmarshalling and default image ordering in templates. |
| pkg/limatype/lima_yaml.go | Extends Image type to include Variant. |
| pkg/instance/start.go | Enforces “stick to the first variant for the target arch” during image download attempts. |
| pkg/driver/wsl2/wsl_driver_windows.go | Allows Variant in WSL2 image validation/unknown-field filtering. |
| pkg/driver/vz/vz_driver_darwin.go | Allows Variant in VZ image validation/unknown-field filtering. |
| cmd/limactl/editflags/editflags.go | Adds --image-variant flag and generates yq to filter .images by variant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…g instance start Signed-off-by: Nachiket Roy <nachiket.roy.2@gmail.com>
d7c3a6f to
782435d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for image variants (for example, Ubuntu Minimal or Debian NoCloud) without introducing additional template files such as
ubuntu-minimal.yamlordebian-nocloud.yaml.A new
variantfield is added to image entries, allowing users to select specific image variants dynamically with the existing--setflag.To preserve the current behavior, standard/server images are listed before minimal variants, ensuring that default template usage continues to select standard images.
How to use
Start Ubuntu 24.04 Minimal:
Start Debian 12 NoCloud:
Tests
Added
TestDefaultSelectedImageIsStandardto verify that standard images remain the default selection by ensuring they are ordered before minimal variants.Fixes #5153
Fixes #5158