Skip to content

Commit 41e95ae

Browse files
committed
fix: load chart correctly under Windows
The tool did not work on Windows at all because the Helm client library expects the file separator to be `/`, specifically, for the templates to be under `/templates`. Fix it by always using forward slashes. Signed-off-by: Utku Ozdemir <utkuozdemir@gmail.com>
1 parent a7384b7 commit 41e95ae

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313
- "test/**"
1414
- ".gitignore"
1515
- "docker/**"
16-
- "helm/**"
1716
- "renovate.json"
1817
- ".krew.yaml"
1918
pull_request:
@@ -25,7 +24,6 @@ on:
2524
- "test/**"
2625
- ".gitignore"
2726
- "docker/**"
28-
- "helm/**"
2927
- "renovate.json"
3028
- ".krew.yaml"
3129

helm/helm.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ func chartAsBufferedFiles() ([]*loader.BufferedFile, error) {
5858
return fmt.Errorf("failed to relativize path %q: %w", path, err)
5959
}
6060

61+
// fix for Windows - the Helm client library expects templates to be under "templates/", i.e., with forward-slash
62+
relativePath = filepath.ToSlash(relativePath)
63+
6164
files = append(files, &loader.BufferedFile{
6265
Name: relativePath,
6366
Data: data,

0 commit comments

Comments
 (0)