fix(repo-server): expire cached Helm chart archives using repo cache expiration#28061
fix(repo-server): expire cached Helm chart archives using repo cache expiration#28061Mangaal wants to merge 11 commits into
Conversation
✅ Preview Environment deployed on Bunnyshell
See: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds configurable Helm chart cache expiration and wires it through repo-server so cached chart archives are evicted after a TTL, with a regression test confirming expiration behavior.
Changes:
- Introduces
WithChartCacheExpiration(time.Duration)and enforces expiration innativeHelmChart.ExtractChart. - Plumbs cache expiration from repo-server cache config into Helm client initialization.
- Adds a unit test + helper to validate cache eviction based on file mtime.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| util/helm/client.go | Adds chart-cache TTL option + eviction logic during chart extraction. |
| util/helm/client_test.go | Adds coverage ensuring cached charts are not reused past expiration. |
| reposerver/repository/repository.go | Wires chart-cache expiration into Helm client opts via init constants. |
| reposerver/cache/cache.go | Exposes repo cache expiration via a getter for wiring. |
| cmd/argocd-repo-server/commands/argocd_repo_server.go | Reads repo cache expiration and passes it into repo-server init constants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #28061 +/- ##
=========================================
Coverage ? 64.58%
=========================================
Files ? 423
Lines ? 58247
Branches ? 0
=========================================
Hits ? 37617
Misses ? 17112
Partials ? 3518 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
8409f47 to
c212500
Compare
This PR makes the repo server Helm chart cache respect the configured repo cache expiration.
Currently, downloaded Helm chart archives could remain in the on-disk chart cache even after the repo cache expires. This meant Argo CD could continue to extract a stale cached chart instead of refreshing it according to
--repo-cache-expiration.The change adds a
chartCacheExpirationoption to the Helm client and wires it from the repo server’s existing repo cache expiration setting. During chart extraction, the Helm client checks the cached chart archive’s modification time. If the archive is older than the configured expiration, it is removed and fetched again before extraction.Closes #4002.
This PR doesn't fully address the issue where the Helm chart doesn't detect changes unless the version is updated. This can be used as a workaround for the root issue #24139.
Checklist: