Remove unnecessary code

This commit is contained in:
Yusuke Kuoka 2019-11-06 22:30:08 +09:00
parent 4751613f39
commit ebad0ad20f
1 changed files with 3 additions and 9 deletions

View File

@ -399,13 +399,13 @@ func (a *App) visitStates(fileOrDir string, defOpts LoadOpts, converge func(*sta
return nil return nil
} }
func (a *App) ForEachStateFiltered(do func(*Run) []error, dagEnabled ...bool) error { func (a *App) ForEachStateFiltered(do func(*Run) []error) error {
ctx := NewContext() ctx := NewContext()
err := a.VisitDesiredStatesWithReleasesFiltered(a.FileOrDir, func(st *state.HelmState, helm helmexec.Interface) []error { err := a.VisitDesiredStatesWithReleasesFiltered(a.FileOrDir, func(st *state.HelmState, helm helmexec.Interface) []error {
run := NewRun(st, helm, ctx) run := NewRun(st, helm, ctx)
return do(run) return do(run)
}, dagEnabled...) })
if err != nil && a.ErrorHandler != nil { if err != nil && a.ErrorHandler != nil {
return a.ErrorHandler(err) return a.ErrorHandler(err)
@ -572,15 +572,9 @@ func (a *App) Wrap(converge func(*state.HelmState, helmexec.Interface) []error)
} }
} }
func (a *App) VisitDesiredStatesWithReleasesFiltered(fileOrDir string, converge func(*state.HelmState, helmexec.Interface) []error, dagEnabled ...bool) error { func (a *App) VisitDesiredStatesWithReleasesFiltered(fileOrDir string, converge func(*state.HelmState, helmexec.Interface) []error) error {
f := a.Wrap(converge) f := a.Wrap(converge)
if len(dagEnabled) > 0 && dagEnabled[0] {
return a.visitStatesWithSelectorsAndRemoteSupport(fileOrDir, func(st *state.HelmState, helm helmexec.Interface) (bool, []error) {
return withDAG(st, helm, a.Logger, a.Reverse, f)
})
}
return a.visitStatesWithSelectorsAndRemoteSupport(fileOrDir, func(st *state.HelmState, helm helmexec.Interface) (bool, []error) { return a.visitStatesWithSelectorsAndRemoteSupport(fileOrDir, func(st *state.HelmState, helm helmexec.Interface) (bool, []error) {
return f(st, helm) return f(st, helm)
}) })