fix: use config for includeNeeds in Deps command

- Add IncludeNeeds() method to DepsConfigProvider interface
- Implement IncludeNeeds() in DepsImpl
- Update depsConfig in tests
- Use c.IncludeNeeds() in run.go instead of hardcoded false

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2026-03-15 09:50:30 +08:00
parent 849c4e4e09
commit c07a82da70
4 changed files with 20 additions and 7 deletions

View File

@ -2626,22 +2626,28 @@ func (a applyConfig) TrackLogs() bool {
type depsConfig struct {
skipRepos bool
includeNeeds bool
includeTransitiveNeeds bool
args []string
}
func (d depsConfig) SkipRepos() bool {
return d.skipRepos
func (c depsConfig) SkipRepos() bool {
return c.skipRepos
}
func (d depsConfig) IncludeTransitiveNeeds() bool {
return d.includeTransitiveNeeds
func (c depsConfig) IncludeNeeds() bool {
return c.includeNeeds
}
func (d depsConfig) Args() string {
func (c depsConfig) IncludeTransitiveNeeds() bool {
return c.includeTransitiveNeeds
}
func (c depsConfig) Args() string {
return ""
}
func (d depsConfig) Concurrency() int {
func (c depsConfig) Concurrency() int {
return 2
}
@ -4116,6 +4122,7 @@ releases:
depsErr := app.Deps(depsConfig{
skipRepos: false,
includeNeeds: false,
includeTransitiveNeeds: false,
})
switch {

View File

@ -31,6 +31,7 @@ type ConfigProvider interface {
type DepsConfigProvider interface {
Args() string
SkipRepos() bool
IncludeNeeds() bool
IncludeTransitiveNeeds() bool
concurrencyConfig

View File

@ -137,7 +137,7 @@ func (r *Run) Deps(c DepsConfigProvider) []error {
r.helm.SetExtraArgs(GetArgs(c.Args(), r.state)...)
return r.state.UpdateDeps(r.helm, false, c.IncludeTransitiveNeeds())
return r.state.UpdateDeps(r.helm, c.IncludeNeeds(), c.IncludeTransitiveNeeds())
}
func (r *Run) Repos(c ReposConfigProvider) error {

View File

@ -32,6 +32,11 @@ func (d *DepsImpl) SkipRepos() bool {
return d.DepsOptions.SkipRepos
}
// IncludeNeeds returns the includeNeeds
func (d *DepsImpl) IncludeNeeds() bool {
return false
}
// IncludeTransitiveNeeds returns the includeTransitiveNeeds
func (d *DepsImpl) IncludeTransitiveNeeds() bool {
return false