Repository navigation
Conversation
Signed-off-by: somaz <genius5711@gmail.com>
somaz94
added a commit
to somaz94/somaz94
that referenced
this pull request
Oct 6, 2026
…merged in OSS contributions
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.
Refs #1561
Problem
With
COLIMA_SAVE_CONFIG=0and a partial, read-only colima.yaml (the Nix setup in #1561),colima startworks butcolima restartstops the VM and then fails, leaving it stopped. With this file:restart ends with:
Cause
colima startrunsprepareConfigfirst, which fills in the flag defaults, the template and the fixed settings.colima restartpassed the file toapp.Startexactly as it was read. With the defaultCOLIMA_SAVE_CONFIG=1that file is the full config saved by the last start, so nothing is missing. With a partial file, restart starts withrootDisk: 0, so Lima tries to shrink the root disk, and withbinfmtunset, which skips the binfmt setup.Fix
restart now prepares the config with the same
prepareConfigas start and validates it before stopping the VM, so a config that fails validation no longer leaves the VM stopped. It still never writes the config file. When the file is missing or has noruntime, prepareConfig would ignore it and use plain defaults, which can grow the data disk (for example afterCOLIMA_SAVE_CONFIG=0 colima start --disk 60), so restart uses the config the instance last started with instead. An unreadable file is still an error, as before.Testing
Test_restartConfigcovers a partial file, a missing file and an unreadable file, and the first two fail on main.go test ./...passes on macOS and in agolang:1.26.1Linux container, and golangci-lint v2.11.3 reports no issues for darwin and linux. I also reproduced the issue on macOS 14 (Apple Silicon, vz, containerd) with the file above: restart fails on main as shown and works with this change whether the VM is running or stopped. With the file moved away, it restarts with the instance's last config and the data disk stays at 20GiB.The
networks.yamlandcolima listsymptoms in #1561 are not covered here.AI disclosure: all of the code and tests in this PR were written with Claude Code (Claude Opus 5.5), and the checks above were run through it. I reviewed the whole diff before opening this PR.