helm/pkg/downloader
Orgad Shaneh 3575c04de7 fix(downloader): prevent concurrent file access errors on Windows
When DownloadTo runs in parallel for the same ref and version, both
processes try to write the same target file, causing "Access Denied"
errors on Windows.

This change refactors the file locking mechanism based on maintainer
feedback:
- Add LockedAtomicWriteFile to internal/fileutil package to encapsulate
  locking logic
- Use the new function for both chart and provenance files
- Lock is cross-process safe and automatically released on process exit
- Files are only written if they don't already exist (avoiding
  duplicate work)

The TestParallelDownloadTo test verifies the fix works correctly.

Fixes #31633

Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com>
2026-01-25 11:42:19 +02:00
..
testdata fix: correctly concat absolute URIs in repo cache 2025-05-15 20:55:08 +02:00
cache.go Updating to tested content cache 2025-08-21 14:33:51 -04:00
cache_test.go Updating to tested content cache 2025-08-21 14:33:51 -04:00
chart_downloader.go fix(downloader): prevent concurrent file access errors on Windows 2026-01-25 11:42:19 +02:00
chart_downloader_test.go Move repo package to versioned directory 2025-09-02 10:19:48 -04:00
chart_downloader_windows_test.go fix(downloader): prevent concurrent file access errors on Windows 2026-01-25 11:42:19 +02:00
doc.go Bump the Go version 2023-03-22 11:29:26 -04:00
manager.go for remaining local variable case inconsistency 2025-11-07 11:41:19 +08:00
manager_test.go Move repo package to versioned directory 2025-09-02 10:19:48 -04:00