Skip to content

Commit

Permalink
Fix multiple --set in --args messed up in helmfile template (#1529)
Browse files Browse the repository at this point in the history
Fixes #1520
  • Loading branch information
mumoshu committed Oct 12, 2020
1 parent 34acf14 commit 3018e82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 9 additions & 1 deletion pkg/app/app.go
Expand Up @@ -1410,6 +1410,15 @@ func (a *App) template(r *Run, c TemplateConfigProvider) (bool, []error) {
// Traverse DAG of all the releases so that we don't suffer from false-positive missing dependencies
st.Releases = allReleases

args := argparser.GetArgs(c.Args(), st)

// Reset the extra args if already set, not to break `helm fetch` by adding the args intended for `lint`
helm.SetExtraArgs()

if len(args) > 0 {
helm.SetExtraArgs(args...)
}

if len(releasesToRender) > 0 {
_, templateErrs := withDAG(st, helm, a.Logger, false, a.Wrap(func(subst *state.HelmState, helm helmexec.Interface) []error {
var rs []state.ReleaseSpec
Expand All @@ -1422,7 +1431,6 @@ func (a *App) template(r *Run, c TemplateConfigProvider) (bool, []error) {

subst.Releases = rs

args := argparser.GetArgs(c.Args(), st)
opts := &state.TemplateOpts{
Set: c.Set(),
OutputDirTemplate: c.OutputDirTemplate(),
Expand Down
7 changes: 0 additions & 7 deletions pkg/state/state.go
Expand Up @@ -1149,15 +1149,8 @@ func (st *HelmState) TemplateReleases(helm helmexec.Interface, outputDir string,
o.Apply(opts)
}

// Reset the extra args if already set, not to break `helm fetch` by adding the args intended for `lint`
helm.SetExtraArgs()

errs := []error{}

if len(args) > 0 {
helm.SetExtraArgs(args...)
}

for i := range st.Releases {
release := &st.Releases[i]

Expand Down

0 comments on commit 3018e82

Please sign in to comment.