Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

apply not removing mounts #96

Closed
brandonkelly opened this issue May 5, 2020 · 5 comments
Closed

apply not removing mounts #96

brandonkelly opened this issue May 5, 2020 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@brandonkelly
Copy link
Member

brandonkelly commented May 5, 2020

If you have a custom mount and then remove it by removing the whole mounts array in the config, running nitro apply will not delete the mount. I even tried running nitro restart, but that didn’t help either.

Steps to reproduce

  1. Add a new mount to the config:

    mounts:
      - source: /Users/brandon/Sites
        dest: /nitro/test
  2. Run nitro apply

  3. Verify that the new mount was added successfully.

    $ nitro ssh
    ubuntu@nitro-dev:~$ cd /nitro
    ubuntu@nitro-dev:/nitro$ ls
    sites  test
    ubuntu@nitro-dev:/nitro$ exit
    
  4. Delete the mount from the config

  5. Run nitro apply

Expected behavior

The mount should be removed, as it’s no longer listed in the config.

Actual behavior

The mount remains, even after restarting the machine.

@brandonkelly brandonkelly added the bug Something isn't working label May 5, 2020
@brandonkelly brandonkelly added this to the v1.0.0 milestone May 5, 2020
@jasonmccallister
Copy link
Member

@brandonkelly can you try this in on the latest release? I just ran through a few scenarios locally and can't reproduce.

@jasonmccallister
Copy link
Member

I'm pretty sure this was resolved when we tagged a beta release. I performed the following steps on my local using 1.0.0-beta.2:

  1. Created machine called issue96 (nitro -m issue96 init)
  2. Manually added a mount using nitro -m issue96 edit
  3. Ran nitro -m issue96 apply
  4. Verified the mount exists using nitro -m issue96 info
  5. Manually removed the mount using nitro -m issue96 edit
  6. Run nitro -m issue96 apply
  7. Verified the mount was removed from the config using nitro -m issue96 context and the machine using nitro -m issue96 info

Here is the output of nitro -m issue96 context for step 3:

php: "7.4"
mounts:
  - source: /Users/jasonmccallister/dev
    dest: /nitro/test
databases:
  - engine: mysql
    version: "5.7"
    port: "3306"

@brandonkelly can you verify this on the latest beta release?

@jasonmccallister
Copy link
Member

jasonmccallister commented May 8, 2020

Ok, I narrowed this down.

When we remove a mount, multipass is leaving the directory in the virtual machine. The mount is actually removed from the machine - see the attached video link - but the dir staying in the machine causes issue with trying to mount it again.

https://drive.google.com/open?id=1WpS40EwojFAnE-9tySqZntjwlYwt9QYQ

We could add another command that runs after a remove to rm -rf the directory. I'm going to check with the multipass team to see if this is expected.

@jasonmccallister
Copy link
Member

Created a ticket in multipass to get some feedback: canonical/multipass#1527

@jasonmccallister
Copy link
Member

When unmounting in apply we should rm the directory from the vm.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants