Fix various issues in chart preparation (#1400)

In #1172, we accidentally changed the meaning of prepare hook that is intended to be called BEFORE the pathExists check. It broke the scenario where one used a prepare hook for generating the local chart dynamically. This fixes Helmfile not to fetch local chart generated by prepare hook.

In addition to that, this patch results in the following fixes:

- Fix an issue that `helmfile template` without `--skip-deps` fails while trying to run `helm dep build` on `helm fetch`ed chart, when the remote chart has outdated dependencies in the Chart.lock file. It should be up to the chart maintainer to update Chart.lock and the user should not be blocked due to that. So, after this patch `helm dep build` is run only on the local chart, not on fetched remote chart.
- Skip fetching chart on `helmfile template` when using Helm v3. `helm template` in helm v3 does support rendering remote charts so we do not need to fetch beforehand.

Fixes #1328
May relate to #1341
This commit is contained in:
KUOKA Yusuke
2020-08-06 09:06:25 +09:00
committed by GitHub
parent 53c3fe9f37
commit b85243a6b4
5 changed files with 33 additions and 108 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ func (f *TestFs) ReadFile(filename string) ([]byte, error) {
str, ok = f.files[filepath.Join(f.Cwd, filename)]
}
if !ok {
return []byte(nil), fmt.Errorf("no registered file found: %s", filename)
return []byte(nil), os.ErrNotExist
}
f.fileReaderCalls += 1