water-hole / ansible-operator

POC Code for the operator backed by ansible
48 stars 29 forks source link

Example UID entrypoint to enable restricted SCC #37

Closed shawn-hurley closed 6 years ago

shawn-hurley commented 6 years ago

When running in OpenShift under the standard restricted SCC the uid is random, so it's necessary to grant access to the anyuid SCC for the current operator to work.

This PR adds a custom entrypoint to the example operator image that patches /etc/passwd at runtime with the container uid so that ansible (ssh) works with the default (restricted) SCC. This approach is used by other images (e.g. openshift-ansible).

This type support should probably eventually be built in the base image so that this customization is not needed. Right now ansible-runner seems to have some partial support for this but it does not work yet.

@codificat

shawn-hurley commented 6 years ago

Thanks again @codificat