adlogix / docker-machine-nfs

Activates NFS on docker-machine
MIT License
794 stars 104 forks source link

Adding mount with similar machine name causes error #66

Closed awudarowicz closed 7 years ago

awudarowicz commented 7 years ago

When we have for example two machines with similar names:

- machine30
- machine30trans

And we want to mount these two machines with docker-machine-nfs there is a problem when:

  1. firstly we try to mount machine30trans - OK
  2. secondly we try to mount machine30 - FAIL with message:
exports:2: got host/group with no directory?: trans

after running above instructions /etc/exports looks like:

trans
# docker-machine-nfs-begin machine30
/Users 192.168.99.100 -alldirs -mapall=1440676671:1381159979
# docker-machine-nfs-end machine30

IMO it's because there is a bug somewhere in code responsible for replacing content in /etc/exports. For example when we want to mount machine30 - script makes search and replace texts which begins with machine30 word and when there is already mounted machine30trans - script removes only machine30 text and left unnecessary trans word.

The problem doesn't occurs when we firstly mount machine30 and secondly machine30trans

tonivdv commented 7 years ago

I'll try to have a look at this as soon as I can. If you have a fix feel free to provide a PR.

tonivdv commented 7 years ago

Can you try #67

awudarowicz commented 7 years ago

Works great, problem solved :)