Skip to content
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: support arbitrary uid for openshift environments #454

Merged
merged 2 commits into from
Jun 6, 2023

Conversation

jkleinlercher
Copy link
Contributor

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 (

configDir := filepath.Join(xdg.ConfigHome, "k8sgpt")
).

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

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

@jkleinlercher jkleinlercher changed the title support arbitrary-uid for openshift environments feat: support arbitrary-uid for openshift environments May 23, 2023
@jkleinlercher jkleinlercher changed the title feat: support arbitrary-uid for openshift environments feat: support arbitrary uid for openshift environments May 23, 2023
@jkleinlercher jkleinlercher force-pushed the feature/arbitrary-uid branch 2 times, most recently from 2e3b925 to fbd724d Compare May 23, 2023 10:32
@jkleinlercher jkleinlercher marked this pull request as ready for review May 26, 2023 18:25
@jkleinlercher jkleinlercher requested review from a team as code owners May 26, 2023 18:25
Signed-off-by: Johannes Kleinlercher <johannes@kleinlercher.at>
@AlexsJones
Copy link
Member

The code looks good but I have no ability to test this, @jkleinlercher does this work on OS environments?

@AlexsJones AlexsJones merged commit 92539ee into k8sgpt-ai:main Jun 6, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug]: k8sgpt fails to start with "mkdir /.config: permission denied"
2 participants