diff --git a/pkg/app/app.go b/pkg/app/app.go index 844b6aeb..6b1da0cc 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -1918,7 +1918,7 @@ func (a *App) template(r *Run, c TemplateConfigProvider) (bool, []error) { func (a *App) withNeeds(r *Run, c DAGConfig, includeDisabled bool, f func(*state.HelmState) []error) (bool, []error) { st := r.state - selectedReleases, deduplicated, err := a.getSelectedReleases(r, false) + selectedReleases, deduplicated, err := a.getSelectedReleases(r, c.IncludeTransitiveNeeds()) if err != nil { return false, []error{err} } @@ -1968,7 +1968,7 @@ func (a *App) withNeeds(r *Run, c DAGConfig, includeDisabled bool, f func(*state // That's why we don't pass in `IncludeNeeds: c.IncludeNeeds(), IncludeTransitiveNeeds: c.IncludeTransitiveNeeds()` here. // Otherwise, in case include-needs=true, it will include the needs of needs, which results in unexpectedly introducing transitive needs, // even if include-transitive-needs=true is unspecified. - if _, errs := withDAG(st, r.helm, a.Logger, state.PlanOptions{SelectedReleases: toRender, Reverse: false, SkipNeeds: c.SkipNeeds(), IncludeNeeds: includeNeeds}, a.WrapWithoutSelector(func(subst *state.HelmState, helm helmexec.Interface) []error { + if _, errs := withDAG(st, r.helm, a.Logger, state.PlanOptions{SelectedReleases: toRender, Reverse: false, SkipNeeds: c.SkipNeeds(), IncludeNeeds: includeNeeds, IncludeTransitiveNeeds: c.IncludeTransitiveNeeds()}, a.WrapWithoutSelector(func(subst *state.HelmState, helm helmexec.Interface) []error { rels = append(rels, subst.Releases...) return nil })); len(errs) > 0 { diff --git a/pkg/config/apply.go b/pkg/config/apply.go index af56582d..9ffafdbc 100644 --- a/pkg/config/apply.go +++ b/pkg/config/apply.go @@ -164,7 +164,7 @@ func (a *ApplyImpl) DiffArgs() string { // SkipNeeds returns the skip needs. func (a *ApplyImpl) SkipNeeds() bool { - if !a.IncludeNeeds() { + if !a.IncludeNeeds() && !a.IncludeTransitiveNeeds() { return a.ApplyOptions.SkipNeeds } return false diff --git a/pkg/config/diff.go b/pkg/config/diff.go index 55f52ca2..7cde8417 100644 --- a/pkg/config/diff.go +++ b/pkg/config/diff.go @@ -87,7 +87,7 @@ func (t *DiffImpl) Set() []string { // SkipNeeds returns the skip needs func (t *DiffImpl) SkipNeeds() bool { - if !t.IncludeNeeds() { + if !t.IncludeNeeds() && !t.IncludeTransitiveNeeds() { return t.DiffOptions.SkipNeeds } diff --git a/pkg/config/lint.go b/pkg/config/lint.go index 282894d9..0d25780f 100644 --- a/pkg/config/lint.go +++ b/pkg/config/lint.go @@ -68,7 +68,7 @@ func (l *LintImpl) IncludeTransitiveNeeds() bool { // SkipNeeds returns the skip needs func (l *LintImpl) SkipNeeds() bool { - if !l.IncludeNeeds() { + if !l.IncludeNeeds() && !l.IncludeTransitiveNeeds() { return l.LintOptions.SkipNeeds } diff --git a/pkg/config/sync.go b/pkg/config/sync.go index e0028c3a..fbbc2483 100644 --- a/pkg/config/sync.go +++ b/pkg/config/sync.go @@ -73,7 +73,7 @@ func (t *SyncImpl) Set() []string { // SkipNeeds returns the skip needs func (t *SyncImpl) SkipNeeds() bool { - if !t.IncludeNeeds() { + if !t.IncludeNeeds() && !t.IncludeTransitiveNeeds() { return t.SyncOptions.SkipNeeds } diff --git a/pkg/config/template.go b/pkg/config/template.go index 1ea327df..6052429f 100644 --- a/pkg/config/template.go +++ b/pkg/config/template.go @@ -99,7 +99,7 @@ func (t *TemplateImpl) SkipCleanup() bool { // SkipNeeds returns the skip needs func (t *TemplateImpl) SkipNeeds() bool { - if !t.IncludeNeeds() { + if !t.IncludeNeeds() && !t.IncludeTransitiveNeeds() { return t.TemplateOptions.SkipNeeds }