mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-04 06:47:37 +02:00
fix(#510): fix golangci-lint run error,add the unit test, add the compatibility when there is blank in the args values.
Signed-off-by: guofutan <guofutan@tencent.com> Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
@@ -69,6 +69,29 @@ func Test_SetExtraArgs(t *testing.T) {
|
||||
if !reflect.DeepEqual(helm.extra, []string{"alpha", "beta"}) {
|
||||
t.Error("helmexec.SetExtraArgs() - two extra arguments missing (overwriting the previous value)")
|
||||
}
|
||||
|
||||
helm.SetExtraArgs("--post-renderer=aaa")
|
||||
fmt.Println(helm.postRenderers)
|
||||
if !reflect.DeepEqual(helm.postRenderers, []string{"--post-renderer=aaa"}) {
|
||||
t.Error("helmexec.SetExtraArgs() - post-renderer assign arguments missing ")
|
||||
}
|
||||
|
||||
helm.SetExtraArgs("--post-renderer", "aaa")
|
||||
fmt.Println(helm.postRenderers)
|
||||
if !reflect.DeepEqual(helm.postRenderers, []string{"--post-renderer", "aaa"}) {
|
||||
t.Error("helmexec.SetExtraArgs() - post-renderer blank arguments missing ")
|
||||
}
|
||||
|
||||
helm.SetExtraArgs("--post-renderer-args=bbb")
|
||||
fmt.Println(helm.postRenderers)
|
||||
if !reflect.DeepEqual(helm.postRenderers, []string{"--post-renderer-args=bbb"}) {
|
||||
t.Error("helmexec.SetExtraArgs() - post-renderer-args assign arguments missing")
|
||||
}
|
||||
|
||||
helm.SetExtraArgs("--post-renderer", "aaa", "--post-renderer-args=bbb")
|
||||
if !reflect.DeepEqual(helm.postRenderers, []string{"--post-renderer", "aaa", "--post-renderer-args=bbb"}) {
|
||||
t.Error("helmexec.SetExtraArgs() - post-renderer arguments not be set correct")
|
||||
}
|
||||
}
|
||||
|
||||
func Test_SetHelmBinary(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user