mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 17:12:59 +02:00
feat: Opt-out dep-builds and repo-updates (#463)
* Improve code organization To make sure it is still readable after upcoming changes to helmfile * feat: `helmfile deps` to update dependencies of all the local charts Resolves #450 * feat: helmfile updates repos and build deps by default But not update deps. Use `helmfile deps` to update deps, and provide `--skip-deps` to skip updating repos and builds deps in sync/diff/apply/template Resolves #415 * Improve integration test coverage
This commit is contained in:
@@ -830,6 +830,23 @@ func (st *HelmState) UpdateDeps(helm helmexec.Interface) []error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// BuildDeps wrapper for building dependencies on the releases
|
||||
func (st *HelmState) BuildDeps(helm helmexec.Interface) []error {
|
||||
errs := []error{}
|
||||
|
||||
for _, release := range st.Releases {
|
||||
if isLocalChart(release.Chart) {
|
||||
if err := helm.BuildDeps(normalizeChart(st.basePath, release.Chart)); err != nil {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(errs) != 0 {
|
||||
return errs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// JoinBase returns an absolute path in the form basePath/relative
|
||||
func (st *HelmState) JoinBase(relPath string) string {
|
||||
return filepath.Join(st.basePath, relPath)
|
||||
|
||||
@@ -524,6 +524,14 @@ func (helm *mockHelmExec) UpdateDeps(chart string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (helm *mockHelmExec) BuildDeps(chart string) error {
|
||||
if strings.Contains(chart, "error") {
|
||||
return errors.New("error")
|
||||
}
|
||||
helm.charts = append(helm.charts, chart)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (helm *mockHelmExec) SetExtraArgs(args ...string) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user