helmfile/test/integration/test-cases
yxxhero fc31dbfc5e
fix: eliminate race condition in rewriteChartDependencies (#2541)
* fix: eliminate race condition in rewriteChartDependencies by copying chart before modifying

Instead of modifying the original Chart.yaml in-place (which causes race
conditions when multiple releases reference the same local chart), copy the
chart to a temporary directory and rewrite the copy's dependencies. This
eliminates the need for per-chart mutex locks and prevents file corruption
when concurrent goroutines process releases sharing the same local chart.

Fixes #2502

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: address PR review comments for rewriteChartDependencies

- Handle non-NotExist errors from st.fs.Stat to surface permission/IO failures
- Reword function doc to clarify temp copy is conditional on rewrite being needed
- Assert rewrittenPath vs tempDir based on expectModified in test table

Signed-off-by: yxxhero <aiopsclub@163.com>

* test: add integration test for issue #2502 race condition with shared local chart

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: separate environments and releases with --- in helmfile.yaml

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: correct file:// path and remove --skip-deps for dependency build

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: correct file:// dependency path (5 levels up to test/integration/)

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: remove output validation from race condition test

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: assert WriteFile/MkdirTemp/RemoveAll/CopyDir in DefaultFileSystem test

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: add strategicMergePatches to trigger chartify in race condition test

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: scope test values under raw subchart and align ConfigMap name with strategic merge patches

The race condition test values.yaml had templates at the top level instead
of scoped under the raw subchart key, causing helm template to produce no
output and chartify's ReplaceWithRendered to fail with an empty
helmx.1.rendered directory. Also align the ConfigMap name to match the
strategicMergePatches target.

Signed-off-by: yxxhero <aiopsclub@163.com>

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
2026-04-20 10:15:47 +08:00
..
chart-deps-condition fix: keep all chart dependencies key / values (#2501) 2026-03-26 13:16:54 +08:00
chart-needs feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
chartify feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
chartify-jsonPatches-and-strategicMergePatches Remove all v0.x references (#1919) 2025-03-08 07:43:21 -06:00
chartify-with-non-chart-dir build: update Helm and plugin versions in CI and Dockerfiles (#2059) 2025-05-30 11:45:28 +08:00
cli-overwrite-environment-values Remove all v0.x references (#1919) 2025-03-08 07:43:21 -06:00
deps-kustomization-i-1402/input skip helm dep up for kustomizations (#1424) 2024-03-26 07:45:39 +08:00
deps-mr-1011/input run deps without chart preparation (#1011) 2024-02-14 17:16:48 +08:00
diff-args feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
fetch-forl-local-chart/input refactor(filesystem): add CopyDir method and optimize Fetch function (#2111) 2025-07-28 16:10:25 -04:00
happypath Remove all v0.x references (#1919) 2025-03-08 07:43:21 -06:00
hcl-secrets Feature/support env hcl and interpolations (#1423) 2024-04-22 08:02:14 +08:00
helmfile-double-fetch/input fix: oci pull directory conflict when download twice (#914) 2023-07-23 21:10:03 +08:00
include-template-func feat: include func support more template functions (#1277) 2024-01-09 14:33:50 +08:00
issue-1749/input Ensure 'helm repo add' is also not pollute on helmfile template (#1887) 2025-01-22 20:42:33 +08:00
issue-1893/input Chartify v0.20.8 update (#1908) 2025-02-05 21:42:05 +08:00
issue-2097 fix: support OCI chart digest syntax (@sha256:...) (#2398) 2026-02-12 20:20:43 +08:00
issue-2103/input fix: include query params in HTTP getter cache key (#2399) 2026-02-14 09:31:53 +08:00
issue-2247 Fix four critical bugs: array merging (#2281), AWS SDK logging (#2270), helmDefaults skip flags (#2269), and OCI chart versions (#2247) (#2288) 2025-11-22 09:27:51 +08:00
issue-2269/input fix: helmDefaults.skipRefresh ignored in runHelmDepBuilds (#2415) 2026-02-22 14:13:05 +05:30
issue-2271/input 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
issue-2275/input 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
issue-2280/input 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
issue-2281-array-merge Fix four critical bugs: array merging (#2281), AWS SDK logging (#2270), helmDefaults skip flags (#2269), and OCI chart versions (#2247) (#2288) 2025-11-22 09:27:51 +08:00
issue-2291/input test: add integration test for issue #2291 (CRD preservation with strategicMergePatches) (#2292) 2025-11-25 09:19:41 +08:00
issue-2297-local-chart-transformers/input fix: resolve issues #2295, #2296, and #2297 (#2298) 2025-11-27 22:13:03 +08:00
issue-2309-kube-context-template fix: pass --kube-context to helm template when using jsonPatches (#2363) 2026-01-16 20:32:33 +08:00
issue-2353-layer-array-replace fix: array merge regression - layer arrays now replace defaults (#2367) 2026-01-18 14:04:54 +08:00
issue-2355/input fix: resolve --validate flag conflict with kustomize in Helm 4 (#2362) 2026-01-18 13:59:55 +08:00
issue-2409-sequential-kubecontext/input fix: eliminate os.Chdir in sequential helmfiles to fix relative path resolution (#2410) 2026-02-22 09:21:46 +08:00
issue-2418/input fix: skip helm repo update when only OCI repos are configured (#2420) 2026-02-25 12:13:20 +08:00
issue-2424-sequential-values-paths/input fix: use absolute baseDir in sequential helmfiles for correct values path resolution (#2425) 2026-02-26 07:47:39 +08:00
issue-2431/input fix: local chart with external dependencies error when repos configured (#2433) 2026-02-28 09:23:04 +08:00
issue-2451-nested-helmfile-array-replace fix: nested helmfile values should replace arrays, not merge element-by-element (#2458) 2026-03-09 18:31:21 +08:00
issue-2502-race-condition-local-chart/input fix: eliminate race condition in rewriteChartDependencies (#2541) 2026-04-20 10:15:47 +08:00
issue-2503-kustomize-fetch/input fix: helmfile fetch fails for kustomization directories (#2504) 2026-03-26 09:44:28 +08:00
kubedog-tracking feat: kubedog integration with unified resource handling (#2383) 2026-03-02 17:15:12 +08:00
kustomized-fetch/input fix fetch does not work with kustomized releases (#624) 2023-01-15 09:19:01 +08:00
oci-parallel-pull/input fix: resolve issues #2295, #2296, and #2297 (#2298) 2025-11-27 22:13:03 +08:00
postrender feat: upgrade Helm version to v3.20.0 and v4.1.0 (#2373) 2026-01-23 12:02:58 +08:00
regression/input Remove all v0.x references (#1919) 2025-03-08 07:43:21 -06:00
secretssops Remove all v0.x references (#1919) 2025-03-08 07:43:21 -06:00
skip-diff-output build: update Helm and plugin versions in CI and Dockerfiles (#2059) 2025-05-30 11:45:28 +08:00
state-values-set-cli-args-in-environments feat: inject cli state values (--state-values-set) into environment templating context (#1917) 2025-02-14 20:49:07 +08:00
suppress-output-line-regex Fix 2337 helm4 stale repo indexes (#2369) 2026-01-21 19:55:56 -05:00
unittest/input feat: add `helmfile unittest` command for helm-unittest integration (#2400) 2026-02-16 09:45:10 +08:00
v1-subhelmfile-multi-bases-with-array-values Remove all v0.x references (#1919) 2025-03-08 07:43:21 -06:00
yaml-overwrite Use gopkg.in/yaml.v2 for Helmfile v0.x (#609) 2023-01-04 18:17:24 +09:00
chart-deps-condition.sh fix: keep all chart dependencies key / values (#2501) 2026-03-26 13:16:54 +08:00
chart-needs.sh feat: Ensure repo update is only run once (#2378) 2026-01-29 19:15:44 -05:00
chartify-jsonPatches-and-strategicMergePatches.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
chartify-with-non-chart-dir.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
chartify.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
cli-overwrite-environment-values.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
deps-kustomization-i-1402.sh skip helm dep up for kustomizations (#1424) 2024-03-26 07:45:39 +08:00
deps-mr-1011.sh run deps without chart preparation (#1011) 2024-02-14 17:16:48 +08:00
diff-args.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
fetch-forl-local-chart.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
happypath.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
hcl-secrets.sh build(deps): update Helm v4 to 4.0.1 and helm-secrets to 4.7.4 (#2304) 2025-11-28 08:43:54 +08:00
helmfile-double-fetch.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
include-template-func.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
issue-1749.sh Add integration tests for #1749 (#1766) 2024-11-06 08:12:20 +08:00
issue-1893.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
issue-2097.sh fix: support OCI chart digest syntax (@sha256:...) (#2398) 2026-02-12 20:20:43 +08:00
issue-2103.sh fix: include query params in HTTP getter cache key (#2399) 2026-02-14 09:31:53 +08:00
issue-2247.sh test: add integration test for issue #2291 (CRD preservation with strategicMergePatches) (#2292) 2025-11-25 09:19:41 +08:00
issue-2269.sh fix: helmDefaults.skipRefresh ignored in runHelmDepBuilds (#2415) 2026-02-22 14:13:05 +05:30
issue-2271.sh 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
issue-2275.sh 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
issue-2280.sh 🐛 Fix four critical issues: environment merging, kubeVersion detection, lookup() with kustomize, and Helm 4 color flags (#2276) 2025-11-21 08:32:54 +08:00
issue-2281-array-merge.sh Fix four critical bugs: array merging (#2281), AWS SDK logging (#2270), helmDefaults skip flags (#2269), and OCI chart versions (#2247) (#2288) 2025-11-22 09:27:51 +08:00
issue-2291.sh test: add integration test for issue #2291 (CRD preservation with strategicMergePatches) (#2292) 2025-11-25 09:19:41 +08:00
issue-2297-local-chart-transformers.sh fix: resolve issues #2295, #2296, and #2297 (#2298) 2025-11-27 22:13:03 +08:00
issue-2309-kube-context-template.sh fix: pass --kube-context to helm template when using jsonPatches (#2363) 2026-01-16 20:32:33 +08:00
issue-2353-layer-array-replace.sh fix: array merge regression - layer arrays now replace defaults (#2367) 2026-01-18 14:04:54 +08:00
issue-2355.sh fix: resolve --validate flag conflict with kustomize in Helm 4 (#2362) 2026-01-18 13:59:55 +08:00
issue-2409-sequential-kubecontext.sh fix: eliminate os.Chdir in sequential helmfiles to fix relative path resolution (#2410) 2026-02-22 09:21:46 +08:00
issue-2418.sh fix: skip helm repo update when only OCI repos are configured (#2420) 2026-02-25 12:13:20 +08:00
issue-2424-sequential-values-paths.sh fix: use absolute baseDir in sequential helmfiles for correct values path resolution (#2425) 2026-02-26 07:47:39 +08:00
issue-2431.sh fix: local chart with external dependencies error when repos configured (#2433) 2026-02-28 09:23:04 +08:00
issue-2451-nested-helmfile-array-replace.sh fix: nested helmfile values should replace arrays, not merge element-by-element (#2458) 2026-03-09 18:31:21 +08:00
issue-2502-race-condition-local-chart.sh fix: eliminate race condition in rewriteChartDependencies (#2541) 2026-04-20 10:15:47 +08:00
issue-2503-kustomize-fetch.sh fix: helmfile fetch fails for kustomization directories (#2504) 2026-03-26 09:44:28 +08:00
kubedog-tracking.sh feat: kubedog integration with unified resource handling (#2383) 2026-03-02 17:15:12 +08:00
kustomized-fetch.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
oci-parallel-pull.sh fix: resolve issues #2295, #2296, and #2297 (#2298) 2025-11-27 22:13:03 +08:00
postrender.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
regression.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
secretssops.sh build(deps): update Helm v4 to 4.0.1 and helm-secrets to 4.7.4 (#2304) 2025-11-28 08:43:54 +08:00
skip-diff-output.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
state-values-set-cli-args-in-environments.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
suppress-output-line-regex.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
unittest.sh feat: add `helmfile unittest` command for helm-unittest integration (#2400) 2026-02-16 09:45:10 +08:00
v1-subhelmfile-multi-bases-with-array-values.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00
yaml-overwrite.sh feat: add Helm 4 support while maintaining Helm 3 compatibility (#2262) 2025-11-19 07:49:30 +08:00