mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-09 08:17:16 +02:00
Add the option to specify an alternative helm binary (#181)
`helm` may not be version compatible. Add an option to specify an alternative `helm` command on runtime, possibly according to the version of tiller running on your cluster.
This commit is contained in:
@@ -56,6 +56,17 @@ func Test_SetExtraArgs(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func Test_SetHelmBinary(t *testing.T) {
|
||||
helm := New(new(bytes.Buffer), "dev")
|
||||
if helm.helmBinary != "helm" {
|
||||
t.Error("helmexec.command - default command is not helm")
|
||||
}
|
||||
helm.SetHelmBinary("foo")
|
||||
if helm.helmBinary != "foo" {
|
||||
t.Errorf("helmexec.SetHelmBinary() - actual = %s expect = foo", helm.helmBinary)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_AddRepo(t *testing.T) {
|
||||
var buffer bytes.Buffer
|
||||
helm := MockExecer(&buffer, "dev")
|
||||
@@ -237,6 +248,15 @@ func Test_exec(t *testing.T) {
|
||||
if buffer.String() != expected {
|
||||
t.Errorf("helmexec.exec()\nactual = %v\nexpect = %v", buffer.String(), expected)
|
||||
}
|
||||
|
||||
buffer.Reset()
|
||||
helm = MockExecer(&buffer, "")
|
||||
helm.SetHelmBinary("overwritten")
|
||||
helm.exec("version")
|
||||
expected = "exec: overwritten version\n"
|
||||
if buffer.String() != expected {
|
||||
t.Errorf("helmexec.exec()\nactual = %v\nexpect = %v", buffer.String(), expected)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Lint(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user