-
Notifications
You must be signed in to change notification settings - Fork 97
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
[BUG] OpenShift compatibility broken in env-injector 1.5.0 #581
Comments
What happens if you set the UID and GID to null through the webhook? Does it work then, or do the default values still get applied? You mention:
Can the securityContextConstraint default be changed to allow a specific UID/GID value? |
I've done a little testing trying to set the UID and GID to null; unfortunately, it appears this sets the values to 0, rather than a yaml null. |
Signed-off-by: Thomas Spear <[email protected]>
I'm not very good with Golang, but I've managed to come up with a patch to provide the old behavior of not setting a UID and GID if the values for those 2 fields result in either (or both) of the UID and GID being set to This is a horribly ugly patch because I really don't know Golang, so if anyone can guide me to clean it up and make it more DRY, please do let me know and I will be happy to make any suggested changes |
@tspearconquest I took another stab at the fix in #594 |
Way better than my hack job! I'll close out my PR. 😄 Thank you!
|
Components and versions
[ ] Controller, version:
x.x.x
(docker image tag)[ x ] Env-Injector (webhook), version:
1.5.0
(docker image tag)[ ] Other
Describe the bug
#548 Introduces a hard-coded default for the injected init-container UIDs and GIDs, and sets the container to run as privileged. In OpenShift, containers run with an arbitrary UID and GID based on a range generated for the namespace they are in.
SecurityContextConstraints by default block running privileged containers or containers with specific UIDs.
To Reproduce
Deploy and use the env-injector in OpenShift 4.11.
Expected behavior
Expected behaviour in OpenShift would be for the init-container to run as a non-privileged container without a specified UID and GID.
Additional context
We could set the
webhook_container_security_context_privileged
field to false trough the webhook, but we currently have no way to disable specifying a UID and a GUID for the init-container.A workaround for this issue could be adding the service account running the pod to a securityContextConstraint with elevated privileges, but is that needed for the injection to work?
The text was updated successfully, but these errors were encountered: