fix: --include-needs should only include direct dependencies

This fix modifies:
 ChartPrepareOptions to include the new IncludeNeeds field
 and updates the Template, Lint, Sync, and Apply commands to use this new option
 separately from include-transitive-needs.

Fixes #1003: The previous fix incorrectly included transitive
dependencies when it should only include direct dependencies.

Updated test expectations in app_template_test.go to reflect the new behavior
Filtered out filtered releases from building groups in state_run.go
 to ensure they are not included in groups
Fixed snapshot test files to reflect the new behavior

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero
2026-03-13 13:21:48 +08:00
parent b0827faf54
commit ed89396736
7 changed files with 65 additions and 37 deletions
+7 -9
View File
@@ -2,14 +2,12 @@ merged environment: &{default map[] map[] map[]}
WARNING: release test2 needs disabled, but disabled is not installed due to installed: false. Either mark disabled as installed or remove disabled from test2's needs
2 release(s) matching app=test found in helmfile.yaml
processing 4 groups of releases in this order:
processing 3 groups of releases in this order:
GROUP RELEASES
1 default/kube-system/logging
2 default/kube-system/kubernetes-external-secrets
3 default/default/external-secrets
4 default/default/my-release
1 default/kube-system/kubernetes-external-secrets
2 default/default/external-secrets
3 default/default/my-release
processing releases in group 1/4: default/kube-system/logging
processing releases in group 2/4: default/kube-system/kubernetes-external-secrets
processing releases in group 3/4: default/default/external-secrets
processing releases in group 4/4: default/default/my-release
processing releases in group 1/3: default/kube-system/kubernetes-external-secrets
processing releases in group 2/3: default/default/external-secrets
processing releases in group 3/3: default/default/my-release