OCPBUGS-89330: Fix cache path to avoid /var/cache/dnf conflict - #775
OCPBUGS-89330: Fix cache path to avoid /var/cache/dnf conflict#775ericahinkleRH wants to merge 1 commit into
Conversation
|
@ericahinkleRH: This pull request references Jira Issue OCPBUGS-89330, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ericahinkleRH The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe ChangesCache Path Configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…/var/cache/dnf conflict The default cache path was /var/cache, which caused chmod failures when running as non-root (UID 1001) because the RHEL base image contains /var/cache/dnf owned by root. EnsureEmptyDirectory() attempts to chmod entries in the cache directory to make them writable before deletion, but non-root users cannot chmod root-owned directories, resulting in: 'chmod /var/cache/dnf: operation not permitted' Fix: Change default from /var/cache to /var/cache/operator-controller to avoid conflicts with system directories in the base image.
155a229 to
9ff63e9
Compare
There was a problem hiding this comment.
Hi @ericahinkleRH, thank you for your contribution.
I noticed the default --cache-path is defined upstream as /var/cache, and this change updates that default. Should this fix be made in the upstream operator-controller project first and then be pulled here through the sync? Or is this issue specific to the downstream OpenShift deployment? I'd like to understand whether there's a reason for carrying this as a downstream-only change.
|
Hi @rashmigottipati! This is OpenShift-specific because of the different base images: Upstream uses When the pod runs as UID 1001, Changing the default to |
There was a problem hiding this comment.
Thanks for the context @ericahinkleRH . That makes sense -the issue is tied to the OpenShift RHEL base image layout rather than the upstream default itself. Given that upstream's distroless image does not contain the conflicting /var/cache/dnf path, a downstream change here seems appropriate. lgtm from that perspective.
|
/jira refresh |
|
@ericahinkleRH: This pull request references Jira Issue OCPBUGS-89330, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/test e2e-aws-techpreview-olmv1-ext |
|
/hold |
|
Given that we don't provide a mechanism in the upstream manifests to modify the arguments to the deployments; this should likely be done upstream. |
|
Thanks for the explanation! You're absolutely right - I should have made this upstream first. I've created the upstream PR here: operator-framework/operator-controller#2835 I included the OCPBUGS-89330 reference in the description so it will automatically attach to the downstreaming PR when it gets merged and pulled downstream. Closing this PR in favor of the upstream fix. Once upstream merges and syncs down, the bug will be automatically attached to that PR. Thanks for catching this! |
|
@ericahinkleRH: This pull request references Jira Issue OCPBUGS-89330. The bug has been updated to no longer refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Problem
On OpenShift 4.19.32, operator-controller pods crash on startup with:
This happens because:
/var/cache/var/cache/dnfowned by rootEnsureEmptyDirectory()tries to chmod root-owned directories, which failsSolution
Change default cache path from
/var/cacheto/var/cache/operator-controllerto avoid conflicts with system directories.Testing
Fixes: https://redhat.atlassian.net/browse/OCPBUGS-89330
Summary by CodeRabbit
--cache-pathdefault from/var/cacheto/var/cache/operator-controller, keeping cache files in a dedicated directory for improved organization.