feat: openshift compatible containers by enabling arbitrary UIDs #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About
This PR adds support for running the container as a user with arbitrary UID.
Changes
Containerfile: default group no longer puppetdbThe default group is now root.
The default group is now set to root in order for the container to have access via group permissions to it's internal and externally managed files as any UID, as long as using the root group.
Containerfile: group = root on relevant directoriesThe following directories have changed their group membership to root (if they were not already):
and their group access is mirroring the user permissions. The
setgidbit has been set on these directories and their subdirectories to ensure permission inheritance.Not entirely sure if all of these are required or if it is comprehensive.
Containerfile:USER=""in/etc/default/puppetdbIn order to workaround a check that compares the defined user in this file when using the startup scripts for puppetdb we can set the
USERvariable to an empty string, otherwise it will try to switch users topuppetdb.20-configure-ssl.sh: no longer setting ownership onSSLDIRThe test will fail with users of arbitrary UID because
id -unwill not be able to give a proper name when the UID is not found in/etc/passwd.We could also simplify the test instead by using
id -u = 0instead of removing this section, but perhaps it is best left up to the user to manage the permissions, especially since the container is no longer tied to thepuppetdbuser after this PR.ssl.sh:set_file_permsremovalSimilar logic here, we want the group to have the same permissions as users, so we should remove/adjust this.