Merge 4c72814bfa into 310cdead2e
This commit is contained in:
commit
934daf4ab5
|
|
@ -1500,7 +1500,7 @@ func (st *HelmState) PrepareCharts(helm helmexec.Interface, dir string, concurre
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(builds) > 0 {
|
if len(builds) > 0 {
|
||||||
if err := st.runHelmDepBuilds(helm, concurrency, builds); err != nil {
|
if err := st.runHelmDepBuilds(helm, concurrency, builds, opts); err != nil {
|
||||||
return nil, []error{err}
|
return nil, []error{err}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1509,7 +1509,7 @@ func (st *HelmState) PrepareCharts(helm helmexec.Interface, dir string, concurre
|
||||||
}
|
}
|
||||||
|
|
||||||
// nolint: unparam
|
// nolint: unparam
|
||||||
func (st *HelmState) runHelmDepBuilds(helm helmexec.Interface, concurrency int, builds []*chartPrepareResult) error {
|
func (st *HelmState) runHelmDepBuilds(helm helmexec.Interface, concurrency int, builds []*chartPrepareResult, opts ChartPrepareOptions) error {
|
||||||
// NOTES:
|
// NOTES:
|
||||||
// 1. `helm dep build` fails when it was run concurrency on the same chart.
|
// 1. `helm dep build` fails when it was run concurrency on the same chart.
|
||||||
// To avoid that, we run `helm dep build` only once per each local chart.
|
// To avoid that, we run `helm dep build` only once per each local chart.
|
||||||
|
|
@ -1520,7 +1520,20 @@ func (st *HelmState) runHelmDepBuilds(helm helmexec.Interface, concurrency int,
|
||||||
//
|
//
|
||||||
// See https://github.com/roboll/helmfile/issues/1521
|
// See https://github.com/roboll/helmfile/issues/1521
|
||||||
|
|
||||||
|
// Perform an update of repos once before running `helm dep build` so that we
|
||||||
|
// can safely pass --skip-refresh to the command to avoid doing a repo update
|
||||||
|
// for every iteration of the loop where charts have external dependencies.
|
||||||
|
if len(builds) > 0 && !opts.SkipRefresh {
|
||||||
|
if err := helm.UpdateRepo(); err != nil {
|
||||||
|
return fmt.Errorf("updating repo: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for _, r := range builds {
|
for _, r := range builds {
|
||||||
|
// Never update the local repository cache here, since we've already
|
||||||
|
// updated it before entering the loop
|
||||||
|
r.skipRefresh = true
|
||||||
|
|
||||||
buildDepsFlags := getBuildDepsFlags(r)
|
buildDepsFlags := getBuildDepsFlags(r)
|
||||||
if err := helm.BuildDeps(r.releaseName, r.chartPath, buildDepsFlags...); err != nil {
|
if err := helm.BuildDeps(r.releaseName, r.chartPath, buildDepsFlags...); err != nil {
|
||||||
if r.chartFetchedByGoGetter {
|
if r.chartFetchedByGoGetter {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue