Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cifsopts not recovered on daemon restart #188

Open
fgodfrey opened this issue Feb 9, 2020 · 2 comments
Open

cifsopts not recovered on daemon restart #188

fgodfrey opened this issue Feb 9, 2020 · 2 comments

Comments

@fgodfrey
Copy link

fgodfrey commented Feb 9, 2020

I am attempting to create a CIFS volume on a Linux host and I want the user ID mapped to a specific UID number (in this example, 999). This works fine until I restart the docker-volume-netshare daemon. At that point, the options are lost.

The following test shows the issue:

Create/test:

docker volume create -d cifs --opt 'cifsopts=uid=999' --name server.example.com/test-vol
docker run -it --rm -v server.example.com/test-vol:/test busybox:latest sh

We see this from the docker-volume-netshare verbose log, which is correct:

mount -t cifs -o uid=999,username='my-user',password='****',rw //server.example.com/test-vol /var/lib/docker-volumes/netshare/cifs/server.example.com/test-vol 

Now, exit the container, restart docker-volume-netshare, and rerun the "docker run" command. Now from the docker-volume-netshare verbose log, we see this, which omits the "uid=999" option:

mount -t cifs -o username='my-user',password='****',rw //server.example.com/test-vol /var/lib/docker-volumes/netshare/cifs/server.example.com/test-vol 

I am not sure if the Docker daemon stores the options or if we would need to introduce a cache in docker-volume-netshare. I am not very proficient with Go so I'm not sure I'll be able to put together a PR to do the latter, but I'll try (or if someone else gets there first, I won't complain :) )

@fgodfrey fgodfrey changed the title cifsopts not recovery on daemon restart cifsopts not recovered on daemon restart Feb 9, 2020
@fgodfrey
Copy link
Author

The docker volume inspect command returns the options. So, I believe the fix is to "inspect" each volume as we discover it in the recovery function and add the options there. I am working on a PR that will do this.

@fgodfrey
Copy link
Author

I put together a PR (#189) that appears to pass CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant