abiosoft / abiosoft/colima

Missing `mounts:` no longer defaults to mounting home directory

Open
#1,533 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
30.8k
Forks
613
PR merge metrics
No merged PRs in 30d

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)
- [x] 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

1. Write or modify the default instance's `colima.yaml` to have no `mounts:` line
2. Run `colima start`
3. Run `colima ssh` and `ls` to observe that the home directory is not mounted
4. Read the `colima.yaml` and observe that it reflects `mounts: null`
5. Run `colima restart`
6. Run `colima ssh` and `ls` to 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](https://github.com/abiosoft/colima/pull/1485/changes#diff-d08e8a0e6744830c2cdd1eca2e9bdb19b6e0b16ce4b1c41f6f6bae2bea92f05fR376) 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)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.