Skip to content

Missing mounts: no longer defaults to mounting home directory #1533

@cflee

Description

@cflee

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: ed90520

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

  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 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions