mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 03:29:45 +02:00
fix: ensure repo update only runs when repositories are configured
This fixes CI issues where tests fail with 'no repositories found' error. The PR #2378 adds a single helm.UpdateRepo() call before running helm dep build commands. However, when no repositories are configured, this call fails. The fix adds a check for len(st.Repositories) > 0 before calling UpdateRepo(). Additionally, updated snapshot files to reflect the new output ordering where repo update happens before building dependencies. Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
+2
-1
@@ -1851,7 +1851,8 @@ func (st *HelmState) runHelmDepBuilds(helm helmexec.Interface, concurrency int,
|
||||
// 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 {
|
||||
// Only do this if there are repositories configured.
|
||||
if len(builds) > 0 && !opts.SkipRefresh && len(st.Repositories) > 0 {
|
||||
if err := helm.UpdateRepo(); err != nil {
|
||||
return fmt.Errorf("updating repo: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user