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

Fix volumes with uid and gid options #10638

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Jun 10, 2021

Podman uses the volume option map to check if it has to mount the volume
or not when the container is started. Commit 28138da added to uid
and gid options to this map, however when only uid/gid is set we cannot
mount this volume because there is no filesystem or device specified.
Make sure we do not try to mount the volume when only the uid/gid option
is set since this is a simple chown operation.

Fixes #10620

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 10, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 10, 2021
@Luap99
Copy link
Member Author

Luap99 commented Jun 10, 2021

@mheon PTAL

@mheon
Copy link
Member

mheon commented Jun 10, 2021

LGTM.

I do wonder if we should start supporting these on their own, outside of o= - that feels like a bit of a hack since they're not really mount opts.

@Luap99 Luap99 force-pushed the volume branch 3 times, most recently from ce70d09 to a736c10 Compare June 11, 2021 11:26
Podman uses the volume option map to check if it has to mount the volume
or not when the container is started. Commit 28138da added to uid
and gid options to this map, however when only uid/gid is set we cannot
mount this volume because there is no filesystem or device specified.
Make sure we do not try to mount the volume when only the uid/gid option
is set since this is a simple chown operation.

Also when a uid/gid is explicity set, do not chown the volume based on
the container user when the volume is used for the first time.

Fixes containers#10620

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@Luap99
Copy link
Member Author

Luap99 commented Jun 11, 2021

@mheon PTAL again, I reworked the logic a bit to make all tests happy.

@mheon
Copy link
Member

mheon commented Jun 11, 2021

To confirm, the no-chown logic is to prevent the image from overwriting our manually-specified UID/GID?

I think a comment to this effect could be valuable.

In general, LGTM

@rhatdan
Copy link
Member

rhatdan commented Jun 11, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2021
@openshift-merge-robot openshift-merge-robot merged commit af9d690 into containers:master Jun 11, 2021
@Luap99 Luap99 deleted the volume branch June 11, 2021 20:48
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

volume mount error with podman 3.x
4 participants