Complete implementation: Fix helmfile list to reflect versions from helmfile.lock for both --skip-charts and normal modes

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-08-19 01:17:09 +00:00
parent 19ede56a51
commit 3dc7b27c6e
1 changed files with 23 additions and 11 deletions

View File

@ -593,17 +593,29 @@ func (a *App) ListReleases(c ListConfigProvider) error {
var err error var err error
if !c.SkipCharts() { if !c.SkipCharts() {
err = run.withPreparedCharts("list", state.ChartPrepareOptions{ // Even though we call withPreparedCharts, the list command is explicitly
SkipRepos: true, // skipped in prepareChartsIfNeeded, so we need to resolve dependencies here
SkipDeps: true, resolvedState, resolveErr := run.state.ResolveDeps()
Concurrency: 2, if resolveErr != nil {
}, func() { err = resolveErr
rel, err := a.list(run) } else {
if err != nil { // Create a new run with the resolved state to get the correct versions
panic(err) resolvedRun := *run
} resolvedRun.state = resolvedState
stateReleases = rel
}) err = resolvedRun.withPreparedCharts("list", state.ChartPrepareOptions{
SkipRepos: true,
SkipDeps: true,
SkipResolve: false, // Explicitly enable dependency resolution
Concurrency: 2,
}, func() {
rel, err := a.list(&resolvedRun)
if err != nil {
panic(err)
}
stateReleases = rel
})
}
} else { } else {
// Even when skipping charts, we should still resolve dependencies from the lock file // Even when skipping charts, we should still resolve dependencies from the lock file
// to show the locked versions instead of the version constraints from helmfile.yaml // to show the locked versions instead of the version constraints from helmfile.yaml