mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-19 05:28:25 +02:00
refactor(filesystem): add CopyDir method and optimize Fetch function (#2111)
* refactor(filesystem): add CopyDir method and optimize Fetch function Signed-off-by: yxxhero <aiopsclub@163.com> * fix(state): conditionally prepare charts for local helmfile command Signed-off-by: yxxhero <aiopsclub@163.com> * fix(state): conditionally prepare charts for local helmfile command Signed-off-by: yxxhero <aiopsclub@163.com> * refactor(state): optimize chart path generation and update dependencies Signed-off-by: yxxhero <aiopsclub@163.com> * fix(test): update path in fetch-forl-local-chart test Signed-off-by: yxxhero <aiopsclub@163.com> * add more test cases Signed-off-by: yxxhero <aiopsclub@163.com> --------- Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
@@ -1372,6 +1372,18 @@ func (st *HelmState) PrepareCharts(helm helmexec.Interface, dir string, concurre
|
||||
// for a remote chart, so that the user can notice/fix the issue in a local chart while
|
||||
// a broken remote chart won't completely block their job.
|
||||
chartPath = normalizedChart
|
||||
if helmfileCommand == "pull" && isLocal {
|
||||
chartAbsPath := strings.TrimSuffix(filepath.Clean(normalizedChart), "/")
|
||||
chartPath, err = generateChartPath(filepath.Base(chartAbsPath), dir, release, opts.OutputDirTemplate)
|
||||
if err != nil {
|
||||
results <- &chartPrepareResult{err: err}
|
||||
return
|
||||
}
|
||||
if err := st.fs.CopyDir(normalizedChart, filepath.Clean(chartPath)); err != nil {
|
||||
results <- &chartPrepareResult{err: err}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
buildDeps = !skipDeps
|
||||
} else if !opts.ForceDownload {
|
||||
|
||||
Reference in New Issue
Block a user