Missing `mounts:` no longer defaults to mounting home directory
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
Research direction
The issue points to a specific condition in the code (likely around line 376 in the linked diff) that determines default home directory mounting. Start by locating the config loading and mount handling logic in the codebase, likely in a file like config/config.go or vm/lima.go. Reproduce the bug by creating a colima.yaml without a mounts key, then trace through the code to see how the nil slice is handled. The fix involves adjusting the condition to treat a missing mounts key as triggering the default mount. Run the existing tests related to mounts to verify the fix.
Written by the indexing model from the issue text.
Description
Description
When starting up a colima.yaml without a mounts: key, it does not default to mounting the user's home directory as documented in the config file.
The config is also updated to mounts: null instead of the documented default of mounts: [].
Version
colima version 0.10.1
git commit: ed905203afdbc6fd4eae6cc301918099ff31e86e
runtime: docker
arch: aarch64
client: v29.2.1
server: v29.2.1
limactl version 2.0.3
zsh: command not found: qemu-img
Operating System
- macOS Intel <= 13 (Ventura)
- macOS Intel >= 14 (Sonoma)
- Apple Silicon <= 13 (Ventura)
- Apple Silicon >= 14 (Sonoma)
- Linux
Output of colima status
INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] docker socket: unix:///Users/cflee/.colima/default/docker.sock
INFO[0000] containerd socket: unix:///Users/cflee/.colima/default/containerd.sock
Reproduction Steps
- Write or modify the default instance's
colima.yamlto have nomounts:line - Run
colima start - Run
colima sshandlsto observe that the home directory is not mounted - Read the
colima.yamland observe that it reflectsmounts: null - Run
colima restart - Run
colima sshandlsto observe that the home directory is still not mounted
Expected behaviour
Upon colima start, when mounts: is not stated, the home directory should be mounted matching the behaviour stated in the config file, and the config file should be updated to mounts: [] (and that should have this behaviour).
# Colima default behaviour: $HOME is mounted as writable.
# Default: []
Additional context
I suspect this is a regression in v0.10.0 from #1485 as the condition for mounting the user's home directory was updated from len(conf.Mounts) == 0 (would be true where the mounts key is missing as it's unmarshaled into a nil slice that has len 0) to conf.Mounts != nil && len(conf.Mounts) == 0 (would be false as it's a nil slice)
- Dominant language
- Go
- Stars
- 30.9k
- Forks
- 618
- Avg merge
- 6d 6h
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from abiosoft/colima
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100