feat: support arbitrary uid for openshift environments #454
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.
Closes #440
📑 Description
with this PR k8sgpt should also be able to run with an arbitrary uid. that is necessary especially in openshift environments because there by default the restricted-v2 SCC sets a uid in the securityContext. currently it depends on uid 65532 because k8sgpt wants to create a .config folder in the users home dir (
k8sgpt/cmd/root.go
Line 88 in 6479cba
since only uid 65532 has a home dir defined in the distroless image an arbitrary uid would want to create the .config dir in the root folder, which is not allowed. so with this PR the XDG_ variables are pointing to a different folder which gets mounted as an emptyDir volume.
✅ Checks
ℹ Additional Information