-
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
Prohibit --uid/gid map and --pod for container create/run #12849
Conversation
Should we add a note to the manpages about this? |
Otherwise LGTM |
sure @mheon do you think it should go in both podman run and podman create? |
Yeah, we usually mirror contents of those manpages very closely |
But why do we forbid it if it works? |
@Luap99 sharing of namespaces within a pod makes it so that the uid/gid maps should be on the pod level not overwritten by the container: #12669 (comment) |
LGTM |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cdoern, rhatdan 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 |
But why? This clearly works just fine right now. This will be a breaking change for may users since uidmapping didn't work on pod earlier so I assume that there are people using podman run --uidmap with --pod. Also what if I want a different uidmapping for all containers in a pod? |
@Luap99 that kind of defies the entire ways that pods and namespaces are supposed to work, if we allow for overwriting this flag then people will assume the same works for other flags that involve namespaces, which it doesn't. Take sysctls for example: #12836 we want things involving namespaces to be defined on the pod level and pod level only. |
OK but then this check needs to check if the pod has a infra bacause if you use a pod without infra this should still be allowed since there are no shared namespaces in this case. Also the check should be in specgen to also cover api users |
@Luap99, can't do the check after |
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.
LGTM, just two small nits
added the test changes, sorry I didn't see you did the capitalization changed as well @Luap99 |
add a check in namespaceOptions() that ensures the user is not setting a new uid/gid map if entering or creating a pod that has an infra container resolves containers#12669 Signed-off-by: cdoern <cdoern@redhat.com>
/lgtm |
/hold cancel |
add a check in namespaceOptions() that ensures the user is not setting a new uid/gid map
if entering or creating a pod that has an infra container
resolves #12669
Signed-off-by: cdoern cdoern@redhat.com