-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: add uid check for chown in initContainer #32
Conversation
I would prefer a solution like this: https://github.com/owncloud/ocis-charts/blob/08943e7b50b39a055bb86b90c03c39c03d51e55f/charts/ocis/values.yaml#L427-L430 |
Indeed this was also the second solution I had in mind, just with the difference to use the |
I wonder how you can force the initcontainer to run as root!? oCIS is doing it like this https://github.com/owncloud/ocis-charts/blob/08943e7b50b39a055bb86b90c03c39c03d51e55f/charts/ocis/templates/idm/deployment.yaml#L28-L38 |
This happens automatically on k3d and Minikube. Only OpenShift behaves differently and just executes the initContainer with a random UID. So I guess the |
I would prefer the approach from the ocis chart. @d7oc can you adapt it? I'm ok to reuse the existing |
Changed. |
I was more talking about the two dedicated init containers as shown in the ocis example https://github.com/owncloud/ocis-charts/blob/master/charts/ocis/templates/idm/deployment.yaml#L28-L50 |
Ah. I'm wondering how this works reliably. The execution order of the initContainers isn't determined AFAIK, so if the |
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ |
👍 Good to know. Will change it. Shouldn't the order in |
Adapted |
But one thing just came to my mind, what happens if the first initContainer fails? Will the second not be executed as well? Found the answer already so all is fine:
|
If the initContainer is started in an environment which is rootless (e.g. OpenShift) the
chown
command will fail. This PR adds a check for the user id before executingchown
to avoid this.