-
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
run: block PODMAN_USERNS and --pod #18601
run: block PODMAN_USERNS and --pod #18601
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 |
Would it make more sense to ignore the env when the pod already has the same userns mode? Consider the case where someone might set it in their bashrc. It would be very annoying to unset the env for all podman run/create commands and you know the pod has already the specified userns mode anyway. |
74f624e
to
471baf7
Compare
I thought about it but I wasn't sure what was better, if blocking or ignoring it; but you made a good point, it will start causing weird errors and failures now, so let's just ignore |
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 one thing, should we mention that in the man page?
i think this is a good idea. everything else LGTM |
/lgtm |
the combination --pod and --userns is already blocked. Ignore the PODMAN_USERNS variable when a pod is used, since it would cause to create a new user namespace for the container. Ideally a container should be able to do that, but its user namespace must be a child of the pod user namespace, not a sibling. Since nested user namespaces are not allowed in the OCI runtime specs, disallow this case, since the end result is just confusing for the user. Closes: containers#18580 Signed-off-by: Giuseppe Scrivano <[email protected]>
471baf7
to
192ad70
Compare
sure, added a note |
/lgtm |
LGTM |
the combination --pod and --userns is already blocked. The PODMAN_USERNS environment variable instead circumvents the check. Make sure the combination is also blocked, otherwise we end up creating containers in a different user namespace than their pod.
Ideally a container should be able to do that, but its user namespace must be a child of the pod user namespace, not a sibling. Since nested user namespaces are not allowed in the OCI runtime specs, disallow this case, since the end result is just confusing for the user.
Closes: #18580
Does this PR introduce a user-facing change?