OCPBUGS-89337: fix for release-4.22#16638
Conversation
…r accumulation The downloads server previously created a new random temp directory via os.MkdirTemp on each startup. When Kubernetes restarts the container (without deleting the pod), the emptyDir volume persists and each restart leaves behind ~3.1G of orphaned artifacts. The defer-based cleanup in main() only runs on graceful exit, not on SIGKILL. Switch to a fixed, well-known path (/tmp/artifacts) and clean it on startup with os.RemoveAll before re-creating it. This guarantees at most one copy of the artifacts exists at any time. Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Address review feedback:
- Use filepath.Glob("/tmp/artifacts*") to also remove stale random
temp directories left by the old os.MkdirTemp code (e.g.
/tmp/artifacts1234567890). The first deployment with the fixed path
would otherwise leave those orphaned dirs behind.
- Add unit tests for NewDownloadsServerConfig directory handling:
1. Clean start creates the directory and populates it
2. Restart with stale data cleans up and recreates correctly
3. Old random temp dirs (/tmp/artifacts*) are also cleaned up
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
|
@matzew: This pull request references Jira Issue OCPBUGS-88450, 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: matzew 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 |
|
/jira refresh |
|
@praveenkumar: This pull request references Jira Issue OCPBUGS-88450, which is invalid:
Comment 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. |
|
/title OCPBUGS-89337: fix for release-4.22 |
|
/retitle OCPBUGS-89337: fix for release-4.22 |
|
@matzew: This pull request references Jira Issue OCPBUGS-89337, 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. |
|
/jira refresh |
|
@matzew: This pull request references Jira Issue OCPBUGS-89337, which is invalid:
Comment 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. |
|
/jira refresh |
|
@matzew: This pull request references Jira Issue OCPBUGS-89337, which is valid. The bug has been moved to the POST state. 7 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. |
|
@matzew: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
Fix included in release 5.0.0-0.nightly-2026-06-18-000016 |
|
@jhadvig can you please take a look into this? |
A manual cherry pick for #16606