Skip to content

fix: SearchFiles matches Windows paths - #223

Open
catadiel wants to merge 1 commit into
helmfile:masterfrom
catadiel:fix/search-files-windows-paths
Open

catadiel wants to merge 1 commit into
helmfile:masterfrom
catadiel:fix/search-files-windows-paths

Conversation

@catadiel

Copy link
Copy Markdown

Fixes #222.

SearchFiles matched the sub path with strings.Contains(path, matchSubPath+"/"), but filepath.Walk gives Windows paths with backslashes: no file of a manifest directory was ever found, and the generated chart had no templates (an assertion error up to v0.27.0, a silently empty render since #207).

The match is now done on the path with the OS separator replaced by /. The check moved to a small SearchFileOpts.matches(path, sep) so the Windows case is tested on the Linux CI too:

  • TestSearchFileOptsMatches: Unix and Windows paths (the Windows cases fail with the previous logic);
  • TestSearchFilesFindsManifests: SearchFiles on a real temp dir.

Checked on Windows: helmfile 1.7.0 rebuilt with chartify v0.27.0 + this change renders the same resources as on Linux (306 for a helmfile of about 30 releases, most of them manifest directories), where the released build fails or renders them empty.

🤖 Generated with Claude Code

filepath.Walk gives Windows paths with backslashes, but SearchFiles kept
only paths containing matchSubPath+"/": no file of a manifest directory
was found and the generated chart had no templates (an assertion error
up to v0.27.0, a silently empty render since helmfile#207).

Match on the path with the OS separator replaced by "/". The check is in
SearchFileOpts.matches(path, sep), tested with Unix and Windows paths.

Fixes helmfile#222

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: carlo tadiello <carlo.tadiello@corvina.io>
@catadiel
catadiel force-pushed the fix/search-files-windows-paths branch from 3504928 to 81f12e1 Compare November 18, 2026 16:10
@catadiel

Copy link
Copy Markdown
Author

Checked with the latest helmfile release as well.

helmfile v1.8.4 (chartify v0.30.0) rebuilt with this branch in place of chartify (go mod edit -replace, Go 1.27.3 as in its go.mod), helmfile template on Windows of a helmfile with about 30 releases, most of them local manifest directories:

build result
v1.8.4 + this PR exit 0, 306 resources, the 8 Namespace/TLSStore of the manifest directories included — the same as Linux on the same input
v1.8.4 as released exit 0, but no resource from any manifest-directory release (only the remote charts render)
v1.7.0 as released fails with assertion failed: unexpected dir entry ""
v1.7.0 + this fix (on chartify v0.27.0) exit 0, 306 resources

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SearchFiles finds no manifests on Windows: manifest-directory charts render empty

1 participant