-
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
Quadlet containers in Quadlet pods ignore user namespace #22931
Comments
I ran one more test to observe the namespaces from the outside:
Test with
Test with
If And one more test to make sure this behavior is not related to the pod ID being used instead of the pod name:
|
Do you have the |
Ok so it is also broken without having them set. It is not exactly clear to me why but #23082 fixes it so feel free to test that. |
The pod was set after we checked the namespace and the namespace code only checked the --pod flag but didn't consider --pod-id-file option. As such fix the check to first set the pod option on the spec then use that for the namespace. Also make sure we always use an empty default otherwise it would be impossible in the backend to know if a user requested a specific userns or not, i.e. even in case of a set PODMAN_USERNS env a container should still get the userns from the pod and not use the var in this case. Therefore unset it from the default cli value. There are more issues here around --pod-id-file and cli validation that does not consider the option as conflicting with --userns like --pod does but I decided to fix the bug at hand and don't try to fix the entire mess which most likely would take days. Fixes containers#22931 Signed-off-by: Paul Holzinger <[email protected]>
Issue Description
If a pod creates a new user namespace and containers are started with the option
--pod-id-file <path>
to associate the container with the pod, the container does not inherit the user namespace of the pod.If the container is instead started with the option
--pod <pod-name>
the container successfully joins the user namespace of the pod.This behavior can be observed in Quadlet containers which are associated with Quadlet pods, because those containers are started with the
--pod-id-file <path>
option.Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
Containers started with the
--pod-id-file
option do not join the user namespace of the pod.Describe the results you expected
Containers started with the
--pod-id-file
option should behave the same way as containers started with the--pod
option and join the user namespace of the pod.podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: