Skip to content

Commit

Permalink
Merge pull request #172 from mumoshu/diff-against-new-release
Browse files Browse the repository at this point in the history
feat: `helmfile diff` also works against non-existent releases
  • Loading branch information
mumoshu authored Jun 25, 2018
2 parents 6856c6e + da337e8 commit af1914c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion helmexec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (helm *execer) DecryptSecret(name string) (string, error) {
}

func (helm *execer) DiffRelease(name, chart string, flags ...string) error {
out, err := helm.exec(append([]string{"diff", "upgrade", name, chart}, flags...)...)
out, err := helm.exec(append([]string{"diff", "upgrade", "--allow-unreleased", name, chart}, flags...)...)
helm.write(out)
return err
}
Expand Down
4 changes: 2 additions & 2 deletions helmexec/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ func Test_DiffRelease(t *testing.T) {
var buffer bytes.Buffer
helm := MockExecer(&buffer, "dev")
helm.DiffRelease("release", "chart", "--timeout 10", "--wait")
expected := "exec: helm diff upgrade release chart --timeout 10 --wait --kube-context dev\n"
expected := "exec: helm diff upgrade --allow-unreleased release chart --timeout 10 --wait --kube-context dev\n"
if buffer.String() != expected {
t.Errorf("helmexec.DiffRelease()\nactual = %v\nexpect = %v", buffer.String(), expected)
}

buffer.Reset()
helm.DiffRelease("release", "chart")
expected = "exec: helm diff upgrade release chart --kube-context dev\n"
expected = "exec: helm diff upgrade --allow-unreleased release chart --kube-context dev\n"
if buffer.String() != expected {
t.Errorf("helmexec.DiffRelease()\nactual = %v\nexpect = %v", buffer.String(), expected)
}
Expand Down

0 comments on commit af1914c

Please sign in to comment.