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

Only the uid:gid of the mounted file itself is being shifted. #73

Open
superironpanda opened this issue May 3, 2024 · 1 comment
Open

Comments

@superironpanda
Copy link

Hi!

I am observing the situation where the uid and gid of the mounted file itself is being 'shifted'.

What I am doing in my terraform:

  • I have a volume, call it volume A, mounted in a container using image X. Then I put some files into this volume. The user is fred with uid and gid of 1000. Then I changed the permissions of the files I put into the volume with 1000:1000 as well.

  • Then I mount the volume A again to the container with the envbox image to home/xxxx. I have passed the environment variable CODER_MOUNTS : /home/xxxx:/home/fred, CODER_INNER_IMAGE of image X, and CODER_INNER_USERNAME fred.

What was observed:

  • Only the folder /home/fred is updated with the ownership of 101000:101000
  • None of the files within this folder/volume is updated with the correct ownership. They are still 1000:1000

The expected behavior is more like the folder/volume and all of the content within is updated with the 'shifted' uid:gid.

I see the code here where it does the shift, but it doesn't seem like it is shifting the files within: https://github.com/coder/envbox/blob/main/cli/docker.go#L565

Could you please let me know if the current implementation is intentional?

Thank you!

@johnstcn
Copy link
Member

johnstcn commented Jul 2, 2024

@superironpanda are you using Envbox in Docker or in Kubernetes? IIRC there is some difference in behaviour between Docker volumes and Kubernetes PVCs w.r.t permissions.

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

2 participants