fix: use config for IncludeNeeds in WriteValues command

- Add IncludeNeeds() to WriteValuesConfigProvider interface
- Implement IncludeNeeds() in WriteValuesImpl
- Update WriteValues function to use IncludeNeeds and IncludeTransitiveNeeds

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2026-03-15 10:27:12 +08:00
parent c03a24f83d
commit 425cf60d9a
3 changed files with 24 additions and 6 deletions

View File

@ -260,11 +260,13 @@ func (a *App) Template(c TemplateConfigProvider) error {
func (a *App) WriteValues(c WriteValuesConfigProvider) error {
return a.ForEachState(func(run *Run) (ok bool, errs []error) {
prepErr := run.withPreparedCharts("write-values", state.ChartPrepareOptions{
SkipRepos: c.SkipRefresh() || c.SkipDeps(),
SkipRefresh: c.SkipRefresh(),
SkipDeps: c.SkipDeps(),
SkipCleanup: c.SkipCleanup(),
Concurrency: c.Concurrency(),
SkipRepos: c.SkipRefresh() || c.SkipDeps(),
SkipRefresh: c.SkipRefresh(),
SkipDeps: c.SkipDeps(),
SkipCleanup: c.SkipCleanup(),
IncludeNeeds: c.IncludeNeeds(),
IncludeTransitiveNeeds: c.IncludeTransitiveNeeds(),
Concurrency: c.Concurrency(),
}, func() {
ok, errs = a.writeValues(run, c)
})
@ -274,7 +276,7 @@ func (a *App) WriteValues(c WriteValuesConfigProvider) error {
}
return
}, false, c.IncludeTransitiveNeeds(), SetFilter(true))
}, c.IncludeNeeds(), c.IncludeTransitiveNeeds(), SetFilter(true))
}
type MultiError struct {

View File

@ -281,6 +281,7 @@ type WriteValuesConfigProvider interface {
SkipDeps() bool
SkipRefresh() bool
SkipCleanup() bool
IncludeNeeds() bool
IncludeTransitiveNeeds() bool
concurrencyConfig

View File

@ -51,6 +51,11 @@ func (c *WriteValuesImpl) SkipCleanup() bool {
return false
}
// IncludeNeeds returns the include needs
func (c *WriteValuesImpl) IncludeNeeds() bool {
return false
}
// IncludeTransitiveNeeds returns the include transitive needs
func (c *WriteValuesImpl) IncludeTransitiveNeeds() bool {
return false
@ -60,3 +65,13 @@ func (c *WriteValuesImpl) IncludeTransitiveNeeds() bool {
func (c *WriteValuesImpl) OutputFileTemplate() string {
return c.WriteValuesOptions.OutputFileTemplate
}
// SkipDeps returns the skip deps
func (c *WriteValuesImpl) SkipDeps() bool {
return false
}
// SkipRefresh returns the skip refresh
func (c *WriteValuesImpl) SkipRefresh() bool {
return false
}