fix: address review comments - preserve tab delimiters in List and fix transitive needs cross-namespace resolution

1. exec.go List(): Filter empty lines without TrimSpace-ing non-empty
   lines, preserving trailing tab separators from helm list output.

2. state.go collectNeedsWithTransitives(): Resolve transitives by full
   ReleaseToID matching (via ID→ReleaseSpec map) instead of name-based
   matching, avoiding cross-namespace ambiguity when multiple releases
   share the same name.

Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/94b03eb4-31e5-4d04-9959-eeaafb695855

Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-27 00:14:14 +00:00
co-authored by yxxhero
parent cd216c6ee9
commit 121fda4900
2 changed files with 16 additions and 10 deletions
+2 -2
View File
@@ -528,8 +528,8 @@ func (helm *execer) List(context HelmContext, filter string, flags ...string) (s
lines := strings.Split(string(out), "\n")
var filtered []string
for _, line := range lines[1:] {
if trimmed := strings.TrimSpace(line); trimmed != "" {
filtered = append(filtered, trimmed)
if strings.TrimSpace(line) != "" {
filtered = append(filtered, line)
}
}
out = []byte(strings.Join(filtered, "\n"))