fix tests

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2026-03-18 17:40:49 +08:00
parent e901ab7ddd
commit f9ca590fdf
2 changed files with 17 additions and 12 deletions

View File

@ -640,22 +640,27 @@ func (a *App) ListReleases(c ListConfigProvider) error {
err := a.ForEachState(func(run *Run) (_ bool, errs []error) {
var stateReleases []*HelmRelease
var err error
var listErr error
if !c.SkipCharts() {
err = run.withPreparedCharts("list", state.ChartPrepareOptions{
prepErr := run.withPreparedCharts("list", state.ChartPrepareOptions{
SkipRepos: true,
SkipDeps: true,
Concurrency: 2,
}, func() {
stateReleases, err = a.list(run)
stateReleases, listErr = a.list(run)
})
if prepErr != nil {
errs = append(errs, prepErr)
}
if listErr != nil {
errs = append(errs, listErr)
}
} else {
stateReleases, err = a.list(run)
}
if err != nil {
errs = append(errs, err)
stateReleases, listErr = a.list(run)
if listErr != nil {
errs = append(errs, listErr)
}
}
if len(stateReleases) > 0 {

View File

@ -2548,7 +2548,7 @@ generated: 2019-05-16T15:42:45.50486+09:00
}
logger := helmexec.NewLogger(io.Discard, "debug")
basePath := t.TempDir()
basePath := filepath.ToSlash(t.TempDir())
state := &HelmState{
basePath: basePath,
FilePath: filepath.Join(basePath, "helmfile.yaml"),
@ -2584,10 +2584,10 @@ generated: 2019-05-16T15:42:45.50486+09:00
}
fs := testhelper.NewTestFs(map[string]string{
"/example/Chart.yaml": `foo: FOO`,
filepath.ToSlash(filepath.Join(basePath, "example/Chart.yaml")): `foo: FOO`,
"/example/Chart.yaml": `foo: FOO`,
filepath.Join(basePath, "example/Chart.yaml"): `foo: FOO`,
})
fs.Cwd = filepath.ToSlash(basePath)
fs.Cwd = basePath
state = injectFs(state, fs)
errs := state.UpdateDeps(helm, false)