-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
container: move volume chown after spec generation #6747
container: move volume chown after spec generation #6747
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
If a second container uses the same volume, does it get chowned? |
might be good to add a test for this. |
|
no, it is chowned only the first time. And it should be race free (a second container that accesses the volume between its creation and being chowned doesn't affect it) |
5c358b7
to
4f2c9b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still convinced this makes more sense as part of the volume mount operation - keeping the separate bool makes sense, but we should put it in the same place that copy-up currently happens. |
the mount currently happens before the spec is generated (the UID/GID are not known) |
That shouldn't be true - mount + copy up of volumes only happens as part of |
yes volumes are mounted with |
Ah, I think I see now - you want to do the chown later, so we don't need a duplicate lookup up UID/GID. OK. |
does it look good for you? |
Sorry for the delay. Few issues with the volume functions, otherwise LGTM. |
Signed-off-by: Giuseppe Scrivano <[email protected]>
move the chown for newly created volumes after the spec generation so the correct UID/GID are known. Closes: containers#5698 Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
4f2c9b1
to
ce74c20
Compare
Does this one also affects v1.9 ? I'm always getting "permission denied" messages for containers running in rootless mode using volumes. |
Yes, this affects every Podman version, I believe. |
OK i'll try to backport your branch to v1.9 and check whether it fixes my problems. |
/retest |
I backported this to v1.9 (which was trivial just two missing imports). But it still fails:
Output / log from Container:
The volume was created by |
tests are green again |
The output of podman-compose looks like this:
|
I don't think the |
It's a bind mount of a Libpod-managed named volume. That's honestly bizarre, and not a good idea. Also, there's no |
/lgtm |
move the chown for newly created volumes after the spec generation so the correct UID/GID are known.
Closes: #5698
Alternative to: github.com//pull/6730
Signed-off-by: Giuseppe Scrivano [email protected]