Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

limactl start: fix the issue where using --set would overwrite the existing instance's lima.yaml without validation. #2501

Merged

Conversation

norio-nomura
Copy link
Contributor

limactl start --set can overwrite the existing lima.yaml without validation, potentially creating an invalid lima.yaml.
e.g.

$ limactl create template://docker-rootful --name docker-test --tty=false
INFO[0000] Terminal is not available, proceeding without opening an editor 
INFO[0000] Attempting to download the image              arch=aarch64 digest="sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" location="https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img"
INFO[0000] Using cache "/Users/norio/Library/Caches/lima/download/by-url-sha256/b154bd45a2ac868f3d26ef79c803af364d0c7308eb72e602324cbf04cf9a8455/data" 
INFO[0000] Run `limactl start docker-test` to start the instance. 
$ limactl start docker-test --tty=false --set ".os = 1"
INFO[0000] Using the existing instance "docker-test"    
FATA[0000] errors inspecting instance: [field `os` must be "Linux"; got "1"] 
$ limactl start docker-test --tty=false
INFO[0000] Using the existing instance "docker-test"    
FATA[0000] errors inspecting instance: [field `os` must be "Linux"; got "1"] 

This PR changes the process to include validation before overwriting.

…existing instance's `lima.yaml` without validation.

Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
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 495db7a into lima-vm:master Jul 23, 2024
27 checks passed
@norio-nomura norio-nomura deleted the validate-libyaml-before-overwriting branch July 23, 2024 05:27
@norio-nomura
Copy link
Contributor Author

Thanks! 🙏🏻

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

Successfully merging this pull request may close these issues.

2 participants