From 425cf60d9a2e5700a58df1758ff87b6c7ee8d89f Mon Sep 17 00:00:00 2001 From: yxxhero Date: Sun, 15 Mar 2026 10:27:12 +0800 Subject: [PATCH] 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 --- pkg/app/app.go | 14 ++++++++------ pkg/app/config.go | 1 + pkg/config/write-values.go | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index 75ee10e5..2966b8dc 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -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 { diff --git a/pkg/app/config.go b/pkg/app/config.go index 4dc71edd..b64296cd 100644 --- a/pkg/app/config.go +++ b/pkg/app/config.go @@ -281,6 +281,7 @@ type WriteValuesConfigProvider interface { SkipDeps() bool SkipRefresh() bool SkipCleanup() bool + IncludeNeeds() bool IncludeTransitiveNeeds() bool concurrencyConfig diff --git a/pkg/config/write-values.go b/pkg/config/write-values.go index 5e5c2ffe..8da5aa2f 100644 --- a/pkg/config/write-values.go +++ b/pkg/config/write-values.go @@ -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 +}