Repository navigation
fix: Add security context to init container - #1300
dan-fernandes wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1300 +/- ##
=======================================
Coverage 94.74% 94.74%
=======================================
Files 42 42
Lines 2741 2741
=======================================
Hits 2597 2597
Misses 144 144 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Having reassessed, this solution works for our current p4x deployments but not in the general case. There are deployments where the specified UID is not 1000, which would still break the init container if propagated. A better solution for the UV cache issue is being trialled in #1322 I think that in general we should have a predetermined UID for the init container, and that there will be problems down the road that arise from this, but as we are not seeing such problems now, and this implementation may have unforeseen consequences I am closing this PR. |
Add security context to init containe.
Recently when updating P4X to v1.11.2 the following error is produced by the init-container:
error: failed to create directory /.cache/uv: Permission denied (os error 13)(I no longer have access to the full stack trace.)Best guess is that UV attempts to cache at
($HOME)/.cache/uvwhere$HOMEis not set due to the user not "existing". By defining a security context we force the init container to use a specific UID (by default1000) which should have a real home dir.